-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgameshow.py
32 lines (25 loc) · 883 Bytes
/
gameshow.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
import random
class Gameshow:
__QUESTIONS=[
("What is the 10th most populous city in California?","Anaheim"),
("True/False? Bir Tawil is a piece of unclaimed between Egypt and Libya","False"),
("Sabritones come from which country?","Mexico"),
]
def __init__(self):
self.__player1 = 0
self.__player2 = 0
self.__current = ()
def get_player1_score(self):
return self.__player1
def get_player2_score(self):
return self.__player2
def inc_player1_score(self):
self.__player1 += 1
def inc_player2_score(self):
self.__player2 += 1
def next_question(self):
while True:
next_q = random.choice(Gameshow.__QUESTIONS)
if next_q != self.__current:
self.__current = next_q
return self.__current