Moved 2022 to own dir
This commit is contained in:
71
2022/02/b.py
Normal file
71
2022/02/b.py
Normal file
@@ -0,0 +1,71 @@
|
||||
import os
|
||||
|
||||
f = open(os.path.dirname(__file__)+"/input.txt", "r")
|
||||
|
||||
tot = 0
|
||||
tot2 = 0
|
||||
|
||||
for l in f:
|
||||
l.strip()
|
||||
choices = l.split(" ")
|
||||
result = 'draw'
|
||||
v = choices[0]
|
||||
o = choices[1].strip()
|
||||
|
||||
round = 0
|
||||
round2 = 0
|
||||
|
||||
if v == 'A':
|
||||
if o == 'X':
|
||||
round2 = 3
|
||||
if o == 'Y':
|
||||
result = 'win'
|
||||
round2 = 1
|
||||
if o == 'Z':
|
||||
result = 'loss'
|
||||
round2 = 2
|
||||
|
||||
if v == 'B':
|
||||
if o == 'X':
|
||||
result = 'loss'
|
||||
round2 = 1
|
||||
if o == 'Y':
|
||||
round2 = 2
|
||||
if o == 'Z':
|
||||
result = 'win'
|
||||
round2 = 3
|
||||
|
||||
if v == 'C':
|
||||
if o == 'X':
|
||||
result = 'win'
|
||||
round2 = 2
|
||||
if o == 'Y':
|
||||
result = 'loss'
|
||||
round2 = 3
|
||||
if o == 'Z':
|
||||
round2 = 1
|
||||
|
||||
if o == 'Y':
|
||||
round2 += 3
|
||||
if o == 'Z':
|
||||
round2 += 6
|
||||
|
||||
tot2 += round2
|
||||
|
||||
if o == 'X':
|
||||
round += 1
|
||||
if o == 'Y':
|
||||
round += 2
|
||||
if o == 'Z':
|
||||
round += 3
|
||||
|
||||
res = 3
|
||||
if result == 'loss':
|
||||
res = 0
|
||||
if result == 'win':
|
||||
res = 6
|
||||
|
||||
tot += round + res
|
||||
|
||||
print(tot)
|
||||
print(tot2)
|
||||
Reference in New Issue
Block a user