Update tt_view to support a draw at the end of the game
This commit is contained in:
@@ -57,6 +57,12 @@ class TTTView:
|
||||
elif game.check_winner('X'):
|
||||
winner = game.players['X']
|
||||
else:
|
||||
raise Exception("Tried to conclude a game which wasn't over!")
|
||||
winner = None
|
||||
print(self.goodbye)
|
||||
if winner:
|
||||
print(f"Congratulations to {winner.name}.")
|
||||
else:
|
||||
print("Nobody won this game.")
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user