Four in a row is the game where you cannot choose where your disc goes — only which column to drop it into. Gravity does the rest. That single restriction is what turns a simple line-making game into one with a genuine theory behind it, and it is why this game was worth solving with a computer at all.
How to play
Seven columns, six rows, forty-two spaces. Take turns dropping a disc into a column; it falls to the lowest free space. Get four of your own in a line — across, up, or diagonally — and you win. Fill the board without one and it is a draw.
That is the whole rulebook. Everything below is about where to drop.
Start in the middle
Not because it feels right — because of how many lines pass through it. Count every possible line of four on the board and see how many cross each column, and the middle column belongs to far more of them than the edges do.
The consequence is sharper than most players expect. The game has been solved: James D. Allen announced a solution in October 1988 and Victor Allis announced an independent one fifteen days later. On the standard board, with perfect play from both sides:
| Opening column | Result with perfect play |
|---|---|
| 1 (edge) | Second player wins |
| 2 | Second player wins |
| 3 | Draw |
| 4 (centre) | First player wins |
| 5 | Draw |
| 6 | Second player wins |
| 7 (edge) | Second player wins |
Most people assume that anything other than the centre is a draw. It is not: four of the seven openings actually lose. The first move is not a preference, it is the game.
Odd and even: the part nobody explains
Here is the idea that separates a good player from a strong one, and it is almost never explained properly.
If a column simply fills up, who gets which square is already decided. Counting the bottom row as row 1, the first player ends up on the odd rows and the second player on the even ones. So a threat — three of your discs with a gap that completes the line — is worth very different amounts depending on which row that gap is in.
- If you moved first, you want your threats on odd rows. Sooner or later the squares below will fill, and the square will be handed to you.
- If you moved second, you want them on even rows, for exactly the same reason.
A threat on the wrong row is not a threat at all; it is a square you are about to give your opponent. This is why strong players will sometimes decline an obvious-looking three-in-a-row and play somewhere quiet instead.
The Hard setting on this page understands this. Medium does not — it counts threats and centre control but is blind to which row they sit on. That is the real difference between the two settings, not just how far ahead they look.
Four ways to play
Standard is seven by six and four in a row: the board everyone knows.
Pop Out is the same board plus one rule, and it is the reason this page exists. Instead of dropping a disc, you may pull one of your own out of the bottom of a column; everything above it drops by one. Positions can be reopened, a wall you built can be taken apart, and a careless pop can complete your opponent's line instead of yours — if a pop makes four for both players at once, the opponent wins. It is an official variant and it is remarkably hard to find playable anywhere online, which seemed like a reason to build it.
Five in a Row widens the board to nine columns and asks for five in a line. The extra width is what makes the fifth disc reachable at all; on a seven-wide board, five in a row would be nearly impossible.
Small is five by four — a couple of minutes a game, and a good board to learn threats on because you can see the whole thing at once.
Pop Out has a consequence nobody writes about, and it is the reason it is worth your time: a pop moves every disc above it down a row, which flips the odd/even parity of every threat in that column at once. What that does to the game is measurable — the first player, who is behind over a full set of openings under the standard rules, comes out twice as far ahead under Pop Out.
The board size decides the game
Change the board and you change the answer. That is not a guess: we wrote a solver and checked it against the published table of solved sizes, then ran it ourselves on the sizes that were within reach.
| Board | Result with perfect play | Verified by |
|---|---|---|
| 4×4 | Draw | our solver |
| 5×4 | Draw | our solver |
| 6×4 | Second player wins | our solver |
| 7×4 | Draw | our solver |
| 4×5 | Draw | our solver |
| 5×5 | Draw | our solver |
| 6×5 | Draw | our solver |
| 7×6 (standard) | First player wins | Allen and Allis, 1988 |
Six columns by four rows is the odd one out: a second-player win, sitting between two draws. Widen it by one column and it becomes a draw again. There is no tidy rule here — each size has to be worked out on its own, which is exactly why people bothered to compute them.
The full table of solved sizes has more of them, along with two patterns worth knowing: a board four or five columns wide is a draw at every height that has been solved, and on an eight-wide board the winner alternates with each row you add.
The last row is not ours. The standard board needs on the order of a hundred billion positions and our solver runs in JavaScript at roughly seventy thousand a second; that is a job for days, not for a web page. So we say plainly whose result it is.
We can measure the centre, too
The solved result above is not ours — but the shape of it shows up in our own opponent, and that we can measure. A search plays the same move in the same position every time, so playing it against itself would just be one game repeated. Instead every combination of first and second move was played out: seven openings times seven replies, forty-nine genuinely different games, both sides on the medium setting.
| Red opens in column | Red wins | Yellow wins | Draws |
|---|---|---|---|
| 1 (edge) | 2 | 4 | 1 |
| 2 | 2 | 2 | 3 |
| 3 | 2 | 3 | 2 |
| 4 (centre) | 5 | 0 | 2 |
| 5 | 2 | 2 | 3 |
| 6 | 0 | 5 | 2 |
| 7 (edge) | 2 | 5 | 0 |
Column four is the only opening that never lost. Every other column is level at best, and across all forty-nine games the player who moved first actually came out behind, 15 wins to 21.
That is the honest version of "the first player wins": the advantage exists, and it lives entirely in one column. Give it away and you are the one defending.
Playing the computer
The opponent searches with alpha-beta pruning and stops when its time is up, so it plays at a steady pace rather than freezing on a hard position. The three settings differ in what they can see, not only in how deep they look:
- Easy looks one move ahead. It takes a win when there is one and blocks a threat when there is one, and otherwise favours the middle. An opponent that ignores an open three does not feel easy, it feels broken.
- Medium searches properly and counts threats and centre control.
- Hard does the same, deeper, and adds the odd/even parity above.
Measured over 40 games per pairing with the sides swapped each time, scoring a draw as half a point:
| Pairing | Score of the stronger side | Drawn |
|---|---|---|
| Easy against random moves | 97.5% | 0% |
| Medium against Easy | 97.5% | 0% |
| Hard against Medium | 73.8% | 33% |
| Hard against Easy | 93.8% | 8% |
The gap between Hard and Medium is the parity rule and nothing else, and a third of those games were still drawn — which is a fair description of a game where the defender has a lot of resources.
Playing a friend online
Choose With a friend online under the board and press Open a table. You get a four-character code — send it to whoever you want to play, they type it in and press Join. There is a chat window in the corner. No accounts, no downloads.
Both of you see the same board, because in this game there is nothing to hide: every disc is on the table from the moment it lands.



