generated from mwc/lab_dice
I changed some code such as rolls and other things..
This commit is contained in:
11
yahtzee.py
11
yahtzee.py
@@ -109,3 +109,14 @@ class Yahtzee:
|
||||
if die.face in choice_ints:
|
||||
choice_ints.remove(die.face)
|
||||
return len(choice_ints) == 0
|
||||
|
||||
def play(self):
|
||||
"""Play an entire game.
|
||||
Starts by greeting the user, then plays rounds until all the goals
|
||||
have been used. When the game is over, tells the player their final
|
||||
score.
|
||||
"""
|
||||
print("Welcome to Yahtzee!")
|
||||
while self.count_unused_goals() > 0:
|
||||
self.play_round()
|
||||
print(f"Your final score was {self.score}")
|
||||
Reference in New Issue
Block a user