You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
720 B

def score_match(x, y):
if x == "A":
if y == "X":
return 3
if y == "Y":
return 6
else:
return 0
if x == "B":
if y == "X":
return 0
if y == "Y":
return 3
else:
return 6
else:
if y == "X":
return 6
if y == "Y":
return 0
else:
return 3
def score(x):
if x == "X":
return 1
if x == "Y":
return 2
else:
return 3
f = open("input.txt", "r")
lines = f.read().splitlines()
current = 0
for line in lines:
x, y = line.split(" ")
current = current + score(y) + score_match(x, y)
print(current)