Connect Four - history, rules, and strategy

Connect Four (Dutch: Vier op 'n rij) is a classic two-player strategy game. The players drop discs into an upright grid of seven columns and six rows, and the first to line up four wins. It is also a solved game: the first player can always win with perfect play by starting in the middle column, as James D. Allen and Victor Allis showed in 1988.

A blue Connect Four grid with red and yellow discs and a winning line of four highlighted
A blue Connect Four grid with red and yellow discs and a winning line of four highlighted

History

Games of four in a row on a grid are old, but the version with an upright frame was designed by Howard Wexler and Ned Strongin and published by Milton Bradley in 1974 as Connect Four. In the frame the discs drop under gravity, so a move is simply the choice of a column. The game sold well around the world and is known by many names, such as Vier op 'n rij in the Netherlands, Vier gewinnt in Germany, and Puissance 4 in France.

The rules

The standard grid has seven columns and six rows. Two players, one with red discs and one with yellow, take turns dropping a disc into a column that is not yet full. The disc falls to the lowest free slot. The first player to make an unbroken line of four discs of their colour, horizontally, vertically, or diagonally, wins. If all 42 slots fill up without a line of four, the game is a draw.

Strategy

Play in the middle: the middle column is part of more lines of four than any other, so discs there do the most work. Look for threats, empty slots that would complete four of your discs, and try to make two at once, since the other player can block only one. Mind the slot below a threat, because filling it lets a disc land on the threat. Strong players also think about which rows their threats are on: as the grid fills up, the order of the remaining moves often decides who is forced to play beneath whose threat.

A solved game

Connect Four is a solved game. In October 1988 James D. Allen, and a few weeks later and independently Victor Allis, showed that the first player can always win with perfect play by starting in the middle column. Allis described the proof in his thesis at the Vrije Universiteit in Amsterdam, with a program called Victor that combined strategic rules with search. If the first disc goes in a column next to the middle, the second player can force a draw, and a first disc in any of the four outer columns loses against perfect play.

The numbers behind the game

The standard grid has 4,531,985,219,092 positions that can be reached in play. In 1995 John Tromp computed the outcome of every opening of eight discs, and modern solvers that combine alpha-beta search with bitboards and large tables can play perfectly in a fraction of a second.

Try it in PictorX

Open Connect Four and click a column to drop a disc. Play a friend on the same screen, or the computer at Easy, Medium, or Hard. Hint shows the column Hard would choose, Undo and Redo step through the game, and Save downloads a PNG of the board. You can also choose Computer against computer and watch the computer play itself.

Frequently asked questions

Who solved Connect Four?

James D. Allen and Victor Allis, independently of each other, in 1988. Both showed that the first player wins with perfect play by starting in the middle column.

What is Connect Four called in Dutch?

Vier op 'n rij, which means four in a row.

Can the first player always win?

Only with perfect play, and only by starting in the middle column. After a first disc next to the middle, best play leads to a draw; after a first disc further out, the second player wins.

How many positions does Connect Four have?

4,531,985,219,092 positions can be reached on the standard grid of seven columns and six rows.

Does PictorX upload anything?

No. The game runs in your browser and the board is drawn on a canvas. Save downloads a PNG, and Edit opens that image in the PictorX editor.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Play Connect Four