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

13 lines
267 B
Python

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