diff --git a/notes.md b/notes.md index 67cc9f6..490d40c 100644 --- a/notes.md +++ b/notes.md @@ -6,12 +6,30 @@ 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 +Class TTTGame is responsible for checking to see whether the game is over. +To check if the game is over, the is_over method is called with the state +as the argument. The is_over method calls board_is_full and check_winner +for both players. To check if the board is full, True is returned if "-" +is in the board still. To check if either player is a winnner, the code isn't +finished, but True should be returned if the board has three of that players +symbols in a row. All of these methods are in the TTTGame class. ### Determining which actions are available at a particular state +Class TTTGame is responsible for determining which actions are available +at a particular state. It returns a list of the index positions where there +are empty spaces '-'. ### Showing the board +Class TTTView is responsible for showing the board. The methods it uses include +print_board, get_action, format_row, and format_value. The TTTView class attributes +are greeting, goodbye, divider, x_color, o_color, and option color. ### Choosing which action to play on a turn +Class TTTHumanPlayer is responsible for choosing which action to play on a turn. +It gets possible actions (blank spaces)from class TTTGame method get_actions. +Then, it converts each of the possible actions into a string and stores as a list +in choices. Then, it converts input to the "> " prompt to integer and stores in +action variable and returns action. ## Checkpoint 2 Notes