ttt_game must copy old board position, using lists

This commit is contained in:
Chris Proctor 2022-05-06 17:01:30 -04:00
parent 0d6a581a01
commit cf366e02c9
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ class TTTGame:
In the resulting state, the current player's symbol has been placed In the resulting state, the current player's symbol has been placed
in an empty board space, and it is the opposite player's turn. in an empty board space, and it is the opposite player's turn.
""" """
new_board = state["board"] new_board = state["board"].copy()
new_board[action] = state["player"] new_board[action] = state["player"]
if state["player"] == "O": if state["player"] == "O":
new_player = "X" new_player = "X"