2.1 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
While view.py appears to be printing the messages involved, it seems that game.py is checking when the game is over within the TTTGame class and determining who the winner is, but there is currently no win condition. It should then be triggered with the is_over method.
Determining which actions are available at a particular state
Once again, the TTTGame class seems responsible for determining which actions are available at a particular state.
Showing the board
The board is shown using TTTView with the methods for print_board() and get_action().
Choosing which action to play on a turn
A player can choose which action to play on a turn from within the TTTHumanPlayer with the method for choose_action().
Checkpoint 3 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 | X | O |
---+---+--- ---+---+--- ---+---+--- ---+---+---
X | X | x | X | x X | O | O | x |
---+---+--- ---+---+--- ---+---+--- ---+---+---
| | | | O | | | |
For the first board, it is simple to choose 6 to win the game. The second board in also 6, but is done to prevent O from winning while setting up a potential win scenario. The third board simultaneously blocks O from making meaningful advances while setting up a guaranteed win scenario. The fourth board is setting up a potential win scenario in which O will be forced to block, leaving X free to set up a situation similar to the third board.
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?
The current and future state demonstrates a 0 value, which implies that the game is as fair as possible since it means an equal number of wins for X or O.