Tic Tac Toe
strategyHow to play Tic Tac Toe
I am X and the computer is O. I tap or click any empty square to place my mark, then the computer answers. The first to line up three in a row across, down, or diagonally wins.
On Hard the AI uses minimax and never loses, so the best I can do is force a draw. I switch to Easy if I want a fairer shot at a win.
About Tic Tac Toe
Tic tac toe is among the oldest games on record, versions of three-in-a-row were scratched into surfaces in ancient Egypt and Rome (the Romans played 'terni lapilli'), and the pencil-and-paper form has been a childhood universal for centuries. It also holds a place in computing history: OXO, a 1952 tic-tac-toe program, was one of the first video games ever made.
The whole game contains only 255,168 possible playthroughs, which is why perfect play is fully known: two competent players always draw. That is not a flaw, it is the lesson. Tic tac toe is most people's first encounter with game theory, forks, forced moves and the idea that some games can be completely solved.
Tic tac toe, played properly
- Open in the center if you can, it joins four winning lines, more than any other square.
- If your opponent takes the center, answer in a corner, never an edge.
- Play for forks: two threats at once is the only way to beat someone who blocks single threats.
- Block forks before they exist, when the opponent owns two corners, an edge move (not a corner) often defuses the trap.
- Every turn, check in order: can I win now, must I block, can I fork, must I block a fork. That checklist never loses.
FAQ
Can tic tac toe be won against a good player?
No, perfect play by both sides always draws, and the full game tree proving it is small enough to write out by hand. Wins only happen when someone misses a threat or a fork, which, among humans, is still gloriously often.
What is a fork?
A move that creates two winning threats simultaneously, your opponent can block only one, so the other wins next turn. Every real tic-tac-toe victory against an attentive opponent comes from a fork; the classic setup is owning two corners around an empty center row or column.
Why is the center square the best opening?
It sits on four lines (one row, one column, two diagonals), corners sit on three, edges on two. More lines means more future threats and forks. Center first, corners second, edges last is the entire positional theory of the game.
Is the computer here beatable?
Play perfectly and you will draw it; leave a fork or an open line and it will take it. Treat it as a trainer: once you can draw every game from both sides, you have effectively solved tic tac toe yourself.