Update tt_view to support a draw at the end of the game

This commit is contained in:
Chris Proctor 2022-04-29 14:47:25 -04:00
parent 2c40608942
commit 487aa30ced
1 changed files with 8 additions and 2 deletions

View File

@ -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)
print(f"Congratulations to {winner.name}.")
if winner:
print(f"Congratulations to {winner.name}.")
else:
print("Nobody won this game.")