A very simple Tic Tac Toe game written in C++ that uses a little bit of brute force which you control the X's and the AI controls the O's. The AI had never lost a single game in my tests.
It contains 2 files:
- "README.md", the introduction file.
- "TicTacToeAI.cpp", the game with AI.
Its UI is very simple. It's like this:
...
...
...
Enter the location you want to put your X (1-9): 1
X..
.O.
...
Enter the location you want to put your X (1-9): 3
XOX
.O.
...
Enter the location you want to put your X (1-9): 8
XOX
.O.
.XO
Enter the location you want to put your X (1-9): 4
XOX
XO.
OXO
Enter the location you want to put your X (1-9): 6
XOX
XOX
OXO
It's a draw!