wrote the function check_winner in game.py so that the game can check whether player X or player O scoring three-in-a-row in any possible arrangement is true (which would lead to that player winning)

This commit is contained in:
kated
2026-06-01 10:55:36 -04:00
parent 57e83744c8
commit 2d0edd1798
4 changed files with 50 additions and 0 deletions

View File

@@ -7,12 +7,20 @@ For each, explain how the behavior is accomplished.
### Checking to see whether the game is over
TTTGame has a method called is_over which checks if either the board is full, player x won, or player o won is true.
### Determining which actions are available at a particular state
TTTGame has a method called get_actions which returns a list of numbers of the empty spaces that a player could choose in their next turn
### Showing the board
TTTView has a method print_board which prints the board with its currently available spaces
### Choosing which action to play on a turn
TTTView has a method get_action which shows the board and asks the current player for which number box they want to choose (in which that player must type in the number of their choice)
## Checkpoint 2 Notes