Incomplete version
This commit is contained in:
25
02/b.py
Normal file
25
02/b.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
f = open(os.path.dirname(__file__)+"/input.txt", "r")
|
||||||
|
|
||||||
|
tot = 0
|
||||||
|
|
||||||
|
selection = {'X': 1, 'Y': 2, 'Z': 3}
|
||||||
|
|
||||||
|
for l in f:
|
||||||
|
choices = l.split(" ")
|
||||||
|
result = 'draw'
|
||||||
|
|
||||||
|
match choices[0]:
|
||||||
|
case 'A':
|
||||||
|
match choices[1]:
|
||||||
|
case 'Y':
|
||||||
|
result = 'win'
|
||||||
|
case 'Z':
|
||||||
|
result = 'loss'
|
||||||
|
|
||||||
|
tot = tot + selection.get(choices[1])
|
||||||
|
if result == 'draw':
|
||||||
|
tot = tot + 3
|
||||||
|
if result == 'win':
|
||||||
|
tot = tot + 6
|
||||||
Reference in New Issue
Block a user