-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuiz.py
36 lines (30 loc) · 911 Bytes
/
Quiz.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
from Player import Player
class Quiz(Player):
players = []
def __init__(self, num_c):
for i in range(num_c):
self.players.append(Player())
def PrintGameStatus(self):
for _Player in self.players:
print(_Player)
return
def WhoAnswers(self):
ok = False
while 1:
for _Player in self.players:
if _Player._Buzz.Premuto():
print(_Player.Name)
self.ValidateAnswer(_Player)
ok = True
break
if ok:
break
return
def ValidateAnswer(self, __Player):
if str(input("Is the answer correct? [y/n]: ")) == "y":
__Player.RightAnswer()
print("Right answer...")
else:
print("Wrong answer...")
__Player._Buzz.NextQuestion()
return