Tic-Tac-Toe
Can you beat the unbeatable AI?
What you'll learn in this level
- How a computer thinks through every possible move before picking one
- Why the hard AI is unbeatable and the easy one isn't
- How an AI plays out every possible game in advance
The AI That Never Loses
Tic-Tac-Toe is a classic game, but did you know it's also a perfect way to learn about how computers think?
You play against an AI. At each difficulty it thinks differently.
How Game AI Works
- 1
Look
The AI looks at the board. It sees which squares are empty. It also sees which ones are taken.
- 2
Think ahead
It thinks through the moves to come. "If I go here, what does the player do then?"
- 3
Score
It gives points to every possible ending. That way it finds out which move is best.
- 4
Decide
It takes the move with the most points. This way of choosing is called minimax. On easy it just picks at random instead.
In a moment you play against the AI. Can you beat the hard mode?
Guess first, then experiment
You are about to play the hard AI. If you play your very best, how does it end?