generated from mwc/lab_tic_tac_toe
53 lines
1.9 KiB
Markdown
53 lines
1.9 KiB
Markdown
# 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 checks whether the board is full and which player (if any)
|
|
wins. If a player meets a win condition (yet to be defined) or
|
|
if all spaces are full and no additional moves are possible, the
|
|
end of the game is (or should be) triggered in is_over()
|
|
|
|
### Determining which actions are available at a particular state
|
|
TTTGame generates the list of available actions based on the current state
|
|
|
|
### Showing the board
|
|
TTTView controls generating the board and printing it to the screen through
|
|
the print_board() and get_action() methods
|
|
|
|
### Choosing which action to play on a turn
|
|
TTTHumanPlayer allows the user to play an action based on the list of
|
|
available actions generated
|
|
|
|
|
|
## 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 | X | O |
|
|
---+---+--- ---+---+--- ---+---+--- ---+---+---
|
|
X | X | x | X | x X | O | O | x |
|
|
---+---+--- ---+---+--- ---+---+--- ---+---+---
|
|
| | | | O | | | |
|
|
|
|
For #1, choosing 6 wins the game. For #2, choosing 6 blocks O from winning.
|
|
For #3, choosing 0 gives a win on the next turn regardless of where O blocks.
|
|
For #4, choosing 4 means O has to block, then if X chooses 6 on the next turn,
|
|
there is a guaranteed win in 2 or 3 regardless of where O blocks.
|
|
|
|
### 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 reward for this state is 0 which tells me there are as many
|
|
games where x wins as loses and most games end in a draw? Does this mean it's a
|
|
fair game?
|
|
|