Add state arguments

This commit is contained in:
Chris Proctor 2022-05-06 16:59:45 -04:00
parent 3bc2251b52
commit 0d6a581a01
1 changed files with 3 additions and 3 deletions

View File

@ -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 == '-':