From c465a8406cfd0c3692da1ef0451c35d42084c6c6 Mon Sep 17 00:00:00 2001 From: Chris Proctor Date: Thu, 28 Apr 2022 17:11:13 -0400 Subject: [PATCH] Check whether game has ended correctly --- ttt_game.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ttt_game.py b/ttt_game.py index 9f0a292..462cccb 100644 --- a/ttt_game.py +++ b/ttt_game.py @@ -36,7 +36,10 @@ class TTTGame: def is_over(self): "Checks whether the game is over." - return self.check_winner('X') or self.check_winner('O') + for space in self.board: + if space == None: + return False + return True def check_winner(self, symbol): "Checks whether the player with `symbol` has won the game."