28 lines
615 B
Python
28 lines
615 B
Python
![]() |
#/usr/bin/env python
|
||
|
|
||
|
# AX, 1, Rock
|
||
|
# BY, 2,Paper
|
||
|
# CZ, 3, Scissors
|
||
|
# loss, 0
|
||
|
# draw, 3
|
||
|
# win, 6
|
||
|
|
||
|
SCORE = {
|
||
|
'AX': 4, # Rock, Rock, Draw
|
||
|
'AY': 8, # Rock, Paper, Win
|
||
|
'AZ': 3, # Rock, Scissors, Loss
|
||
|
'BX': 1, # Paper, Rock, Loss
|
||
|
'BY': 5, # Paper, Paper, Draw
|
||
|
'BZ': 9, # Paper, Scissors, Win
|
||
|
'CX': 7, # Scissors, Rock, Win
|
||
|
'CY': 2, # Scissors, Paper, Loss
|
||
|
'CZ': 6, # Scissors, Scissors, Draw
|
||
|
}
|
||
|
|
||
|
score = 0
|
||
|
with open("input.txt", "r") as f:
|
||
|
for line in f:
|
||
|
line = line.replace(" ", "").strip()
|
||
|
score += SCORE[line]
|
||
|
|
||
|
print(score)
|