Classic 2-player Tic-Tac-Toe right in your browser. No downloads, no sign-in.
Tic-Tac-Toe is a "solved" game. This means that if both players play perfectly, every single game will result in a draw. Because the board is only 3x3, there are a very limited number of possible board states (exactly 5,478 legal states).
When a computer plays Tic-Tac-Toe, it doesn't use modern neural networks or machine learning. It uses a foundational, brute-force Game Theory algorithm called Minimax.
Before making a move, the AI simulates every possible move it could make. Then, for each of those moves, it simulates every possible move the human could make in response, and so on, recursively, until the game is over.
The AI assumes the human will always play perfectly to minimize the AI's score. Therefore, the AI chooses the move that maximizes its minimum guaranteed score. This guarantees the AI will always win or draw, but never lose.
Why doesn't the AI need a complex Neural Network to play Tic-Tac-Toe perfectly?