-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02.py
63 lines (53 loc) · 1.51 KB
/
02.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
f = open('c:/Projects/Python/Codecember/02/02_input.txt', 'r')
a, x = zip(*[x.split(' ') for x in [x.strip() for x in f.readlines()]])
my_choice_value = 0
my_win_value = 0
for i in x:
if i == "X":
my_choice_value += 1
elif i == "Y":
my_choice_value += 2
elif i == "Z":
my_choice_value += 3
for i in range(0,len(a)):
if x[i]=="X" and a[i] == "A":
my_win_value += 3
elif x[i]=="Y" and a[i] == "B":
my_win_value += 3
elif x[i]=="Z" and a[i] == "C":
my_win_value += 3
elif x[i]=="X" and a[i] == "C":
my_win_value += 6
elif x[i]=="Y" and a[i] == "A":
my_win_value += 6
elif x[i]=="Z" and a[i] == "B":
my_win_value += 6
print("My total score is " + str(my_choice_value+my_win_value))
choice_value = 0
win_value = 0
for i in range(0,len(x)):
if x[i]=="X":
win_value += 0
if a[i] == "A":
choice_value += 3
elif a[i] == "B":
choice_value += 1
elif a[i] == "C":
choice_value += 2
if x[i]=="Y":
win_value += 3
if a[i] == "A":
choice_value += 1
elif a[i] == "B":
choice_value += 2
elif a[i] == "C":
choice_value += 3
if x[i]=="Z":
win_value += 6
if a[i] == "A":
choice_value += 2
elif a[i] == "B":
choice_value += 3
elif a[i] == "C":
choice_value += 1
print("My cryptic score is " + str(choice_value+win_value))