Get the player's next valid move.
(board: List[str])
| 109 | |
| 110 | |
| 111 | def get_player_move(board: List[str]) -> int: |
| 112 | """Get the player's next valid move.""" |
| 113 | move: str = " " |
| 114 | while move not in "1 2 3 4 5 6 7 8 9".split() or not is_space_free( |
| 115 | board, int(move) |
| 116 | ): |
| 117 | print("What is your next move? (1-9)") |
| 118 | move = input() |
| 119 | return int(move) |
| 120 | |
| 121 | |
| 122 | def choose_random_move_from_list( |