This program will be different from all the other programs in this book because it will accept no command-line arguments. The game will always start with a blank “board” and with the X player going first. It will use the input() function to interactively ask each player, X and then O, for a move. Any invalid move, such as choosing an occupied or non-existing cell, will be rejected. At the end of each turn, the game will decide to stop if it determines there is a win or a draw.
- Use and break out of an infinite loop
- Add type hints to your code
- Explore tuples, named tuples, and typed dictionaries
- Use mypy to analyze code for errors, especially misuse of types