1.6 KiB
Tic Tac Toe notes
Checkpoint 1 Notes
Which class is responsible for each of the following behaviors? For each, explain how the behavior is accomplished.
Checking to see whether the game is over
TTTGame. TTTGame.is_over checks to see if one of the following is true: 1) the board is full, 2) X is in a winning state, or 3) O is in a winning state.
Determining which actions are available at a particular state
TTTGame. TTTGame.get_actions checks each location on the board to see if it has been filled with an X or an O and returns the indices of each location that has neither.
Showing the board
TTTView. TTTView.print_board prints the state of the first three locations on the board, a divider, the state of the second three locations, another divider, and the state of the final three locations.
Choosing which action to play on a turn
TTTHumanPlayer or TTTComputerPlayer. TTTHumanPlayer.choose_action gets the possible actions that can be done and allows the user to pick one. TTTComputerPlayer chooses an action based on the strategy the computer is using.
Checkpoint 2 Notes
TTT Strategy
For each of the following board states, if you are playing as X and it's your turn, which action would you take? Why?
| O | O | | O | X | X | O |
---+---+--- ---+---+--- ---+---+--- ---+---+---
X | X | | X | X | O | O | |
---+---+--- ---+---+--- ---+---+--- ---+---+---
| | | | O | | | |
Initial game state
You can get the inital game state using game.get_initial_state(). What is the current and future reward for this state? What does this mean?