aoc
/
2022
1
0
Fork 0
2022/day02.py

13 lines
270 B
Python

import fileinput
part1, part2 = 0, 0
for line in fileinput.input():
theirs = ord(line[0]) - ord('A')
ours = ord(line[2]) - ord('X')
part1 += ours + (4, 7, 1)[(ours - theirs) % 3]
part2 += (1, 4, 7)[ours] + (theirs + ours - 1) % 3
print(part1, part2)