2022 2a solved

kwout 11 months ago
parent d25bd9fbd4
commit 40ce3e8e19
  1. 25
      2022/day2/2a.py
  2. 3
      2022/day2/input.txt.sample

@ -0,0 +1,25 @@
lines = [i for i in open("input.txt", 'r').read().splitlines()]
sum = 0
for l in lines:
match(l):
case "A X":
sum += 4
case "A Y":
sum += 8
case "A Z":
sum += 3
case "B X":
sum += 1
case "B Y":
sum += 5
case "B Z":
sum += 9
case "C X":
sum += 7
case "C Y":
sum += 2
case "C Z":
sum += 6
print(sum)
Loading…
Cancel
Save