Skip to content
Vuk Cvetković
GamesBuilt:

Four in a Row

Drop your discs into the board and line up four before your opponent does: across, down or on a diagonal. Who you play is the whole of the difficulty. The beginner barely looks, and the grandmaster sees further ahead than you will.

Wins0Losses0

Choose your opponent

Plays near the middle and only sees its own fours. It will not block yours.

Press a column to drop a disc, or slide a finger along the top of the board and let go. The arrow keys pick a column and Enter drops, or press 1 to 7.

How to play

  1. Four in a row wins

    A disc falls to the lowest free square in its column. The first to have four of their own in a line, across, down or on a diagonal, wins, and a board that fills up first is a draw.

  2. Two threats at once

    Three in a line with the fourth square free is a threat. One can be blocked and two cannot, and that is how most games are won: not with one long trap, but with a move that opens two squares at once.

  3. Mind what is underneath

    Never drop a disc straight under a square your opponent wins on, because it lets them play there. Late in a game the whole fight is often about who has to play under whose threat first.

  4. Pick who you are playing

    Four opponents, from the beginner to the grandmaster, and your wins and losses are kept for each. Who goes first alternates from game to game, and it matters: with perfect play, the side that goes first and starts in the middle column always wins.

How it is built

No canvas and no game library, like the rest of them. The board is a drawing laid over the discs rather than a background under them: one shape of plastic with 42 holes cut in it, and every disc a little wider than its hole. So a disc falls behind the bars between the rows and shows through the holes, the way it does on the real one, and the rim of every disc stays hidden behind the plastic. The inside of each hole is two thin crescents, shaded at the top and lit at the bottom, and that pair is most of why a disc looks set into the board rather than painted on it.

A disc falls under gravity rather than for a set time, so a long fall down an empty column and a short one onto a nearly full column each take the time a real one would. It bounces twice off whatever it lands on, each bounce lower than the last. The movement is the parabola itself, drawn with the exact curves for free fall, and the three clicks you hear land on the same three moments. A new game empties the board the way the slider under a real one does: every disc drops out of the bottom at once, the lowest first.

The opponent keeps a score of the position as it goes rather than working it out from scratch. The board has 69 lines of four, each line counts the discs of each colour in it, and a disc only changes the lines through its own square, thirteen at most. A win is a count reaching four, a threat is a count of three with the fourth square empty, and the value of the whole board is a running total. The one piece of real theory in it is parity: the board fills from the bottom, and with perfect play the side that went first ends up with the odd rows and the other side with the even ones, so a threat on your own rows is worth more than one on theirs.

The four differ in how far ahead they look. The beginner takes its own four most of the time and otherwise plays near the middle. The amateur looks three moves ahead, which is enough to take a win, block one and never hand one over. The master looks seven ahead and picks among the moves within a few points of its best, so two games against it rarely go the same way. The grandmaster searches one move deeper at a time until a third of a second is up, reusing a table of 262,144 positions it has already seen. From the opening that is thirteen to fifteen moves ahead, and from about the sixteenth disc on it usually knows how the game ends.

Each of them beats the one below it nearly every time. In 60 simulated games per pair, with the first move alternating, the amateur beat the beginner 60 times, the master beat the amateur 57 times, and the grandmaster beat the master 57 times and drew twice. The pause before an opponent’s disc moves, and the stop it sometimes makes over another column, are only there so you can follow the move: by then the choice has already been made.

Esc