-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActivities.py
More file actions
42 lines (25 loc) · 1012 Bytes
/
Activities.py
File metadata and controls
42 lines (25 loc) · 1012 Bytes
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
class Activities():
def randomComicCompare(self, comicAccess, eloMaths):
randomComicOne = comicAccess.getRandomComic()
while True:
randomComicTwo = comicAccess.getRandomComic()
if randomComicOne.name != randomComicTwo.name:
break
print(randomComicOne)
print("\n")
print(randomComicTwo)
print("\n")
while True:
answer = input("Which is better? [1/2]")
if answer == "1":
win = [1,0]
break
if answer == "2":
win = [0,1]
break
print("Not an option, try again")
new_values = eloMaths.updateEloScores(randomComicOne['Score'], randomComicTwo['Score'], win)
comicAccess.updateElo(randomComicOne.name, new_values[0])
comicAccess.updateElo(randomComicTwo.name, new_values[1])
print(new_values)
print(comicAccess.csv)