A somewhat intelligent game of Tic Tac Toe (Logic implementation uses only basic Python and no other libraries)
The available engines are,
- Novice engine: No intelligence. Chooses randomly.
- Beginner engine: Only focuses on blocking you (the player) from winning and has no concern for winning itself.
- Competent engine: Somewhat intelligent. Tries to block you from winning and also to win itself. But doesn't consider more than one step ahead.
Please note that by default the playing mode is set to the 'Beginner engine'.
Just run the ./tic_tac_toe.py
file to play a round.
The initial grid looks like the following,
===== ===== =====
1 2 3
===== ===== =====
4 5 6
===== ===== =====
7 8 9
===== ===== =====
To choose a position you should enter the corresponding number of that position.
The computer engine will be playing with the symbol 'X' and you (the player) will be playing with the symbol 'O'.