How to play Tic Tac Toe

← All games

Three in a row on a three-by-three grid. It's the first strategy game most people learn and the first one most people work out how to never lose — which is exactly what makes a genuinely perfect opponent interesting to sit across from.

The goal

Nine squares. Two players take turns claiming one, X and O. The first to get three of their own mark in a straight line — across, down, or corner to corner — wins, and the line is struck through so there's no arguing about it. If all nine squares fill up and nobody has a line, the game is a draw.

That's the entire rule set, and it hasn't been added to here. What the game gives you on top is a choice of who you're playing and, if that's the computer, how well it plays.

Controls

The numeric keys are laid out the way a phone keypad is, so the mapping is worth learning if you play on a laptop: it turns the whole game into five keystrokes. The board locks briefly while the computer is thinking, so you can't accidentally take its square out from under it.

The two modes

Versus the computer

The default. You choose three things before the first round and they stick until you change them: which mark you play (X or O), who takes the first move (you, the computer, or random), and how strong the opponent is. X-goes-first is only a convention, and it loses to a clearer rule — whoever you said goes first, goes first, in whatever mark you picked.

The computer takes a short beat before answering. That's deliberate: an instant reply reads as the page doing something rather than as an opponent making a move.

Pass and play

Two people, one device. X always opens, the board hands back and forth, and the difficulty, mark and first-move settings disappear from the sheet because there's nobody to apply them to. The status line tells whoever's turn it is that it's theirs, and the two marks are strongly different colours — gold for X, cool blue for O — so nobody has to squint at the board to work out where they stand.

Pass and play keeps its own running tally, separate from your record against the computer, so an evening of games with someone else never touches your other numbers.

The three difficulty levels

All three play the same rules; what changes is how much of the board the computer is actually looking at.

Easy — makes mistakes

Good for a warm-up, and the right setting for a child or anyone who just wants to win a few. It takes a winning line when it can see one, blocks yours only about half the time, and otherwise plays wherever. The mistakes it makes are the human kind — getting absorbed in building its own row and forgetting to stop yours — so it loses regularly without ever feeling like it's throwing the game.

Medium — a real challenge

The setting most people should be on. It plays the perfect move about two times in three, and something merely sensible the rest — it still finishes its own lines and still blocks yours, it just stops thinking about where else its mark should go. The result is an opponent that punishes careless play, holds the draw against solid play, and can be beaten by someone who sets up a genuine double threat and waits for the lapse. Never a free win, never a wall.

Impossible — plays perfectly, never loses

This one searches the entire game, every position to the end, and always picks a move that cannot lose. It isn't a difficulty setting so much as a fact: you cannot beat it. Play flawlessly and you draw; make one mistake and it takes the game.

Against Impossible, a draw is the win. That's what the draw counter in the tally is really keeping track of — a string of draws against a perfect opponent means you didn't put a foot wrong all evening.

When several moves are exactly equally good it picks between them at random, so it can't lose and still doesn't play you the same game twice. It's the setting to use if you want to actually learn the game, because every single mistake you make is punished immediately and visibly.

Tips

Take the centre

The middle square sits on four of the eight possible lines — more than any other square. If you're opening, take it. If your opponent opens somewhere else, take it then. Most losses between beginners trace back to someone giving away the centre for no reason.

Corners beat edges

Each corner is on three lines; each edge square is on only two. When the centre is gone, corners are the next-best real estate, and two corners on opposite sides of the board create far more threats than any pair of edges will.

Block, but check for the fork first

If your opponent has two in a line with the third square open, you have to block — but before you do, check whether you have a line you could complete this turn instead. Winning outright beats blocking every time. Beginners block reflexively and miss their own win sitting on the board.

Learn the fork

A fork is one move that creates two separate winning threats at once. Your opponent can only block one, so the other goes in next turn. This is the single idea that separates people who occasionally win from people who never lose — and it's how Medium gets beaten. The classic version: open in a corner, and if the reply is anything but the centre, take the opposite corner and start building two lines through it.

Defend a fork by making a threat

The counter to someone else's fork is not to sit and block. It's to make a threat of your own that forces them to respond — that spends their turn on defence and takes the fork off the board. If you can't threaten, block the square that would create the double, not either of the lines.

Accept the draw

Played perfectly by both sides, tic tac toe is a draw every time. That isn't a flaw in the game, it's the point of it: once you know a game is solved, the interesting question stops being "can I win" and becomes "can I go a whole evening without slipping". Set the computer to Impossible and try to string together ten draws.

Good to know