Check whether game has ended correctly

This commit is contained in:
Chris Proctor 2022-04-28 17:11:13 -04:00
parent 7adfaa80aa
commit c465a8406c
1 changed files with 4 additions and 1 deletions

View File

@ -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."