diff --git a/ttt_game.py b/ttt_game.py index cdf7463..afd26c5 100644 --- a/ttt_game.py +++ b/ttt_game.py @@ -45,9 +45,9 @@ class TTTGame: we set the reward for X winning to 1 and the reward for O winning to -1. All other states (unfinished games and games which ended in a draw) are worth 0. """ - if self.check_winner('X'): + if self.check_winner(state, 'X'): return 1 - elif self.check_winner('O'): + elif self.check_winner(state, 'O'): return -1 else: return 0 @@ -73,7 +73,7 @@ class TTTGame: "Checks whether a move is valid" return move in self.get_valid_moves() - def board_is_full(state, self): + def board_is_full(self, state): "Checks whether all the spaces in the board are occupied." for space in state["board"]: if space == '-':