From 0d6a581a01b675ffbc6168390d9d6e63139436cf Mon Sep 17 00:00:00 2001 From: Chris Proctor Date: Fri, 6 May 2022 16:59:45 -0400 Subject: [PATCH] Add state arguments --- ttt_game.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 == '-':