This commit is contained in:
2022-12-02 12:27:04 +02:00
parent 37e1dc820a
commit 08b0b82100

28
02/b.py
View File

@@ -3,6 +3,8 @@ import os
f = open(os.path.dirname(__file__)+"/input.txt", "r") f = open(os.path.dirname(__file__)+"/input.txt", "r")
tot = 0 tot = 0
tot2 = 0
for l in f: for l in f:
l.strip() l.strip()
choices = l.split(" ") choices = l.split(" ")
@@ -11,21 +13,46 @@ for l in f:
o = choices[1].strip() o = choices[1].strip()
round = 0 round = 0
round2 = 0
if v == 'A': if v == 'A':
if o == 'X':
round2 = 3
if o == 'Y': if o == 'Y':
result = 'win' result = 'win'
round2 = 1
if o == 'Z': if o == 'Z':
result = 'loss' result = 'loss'
round2=2
if v == 'B': if v == 'B':
if o == 'X': if o == 'X':
result = 'loss' result = 'loss'
round2 = 1
if o == 'Y':
round2 = 2
if o == 'Z': if o == 'Z':
result = 'win' result = 'win'
round2 = 3
if v == 'C': if v == 'C':
if o == 'X': if o == 'X':
result = 'win' result = 'win'
round2 = 2
if o == 'Y': if o == 'Y':
result = 'loss' result = 'loss'
round2 = 3
if o == 'Z':
round2 = 1
if o == 'X':
round2 = round2 + 0
if o == 'Y':
round2 = round2 + 3
if o == 'Z':
round2 = round2 + 6
tot2 = tot2 + round2
if o == 'X': if o == 'X':
round = round + 1 round = round + 1
@@ -43,3 +70,4 @@ for l in f:
tot = tot + round + res tot = tot + round + res
print(tot) print(tot)
print(tot2)