Connect Four

Seven columns, six rows, four in a row. Click a column to drop a disc. The computer looks one move ahead and no further, so it can be trapped.

Turn: Red to play

Click anywhere in a column to drop into it. The lowest empty slot takes the disc.

0

Won

0

Lost

0

Drawn

The record is kept against the computer only, and it is stored in this browser. It is not sent anywhere, and two-player games do not change it.

What this tool does

The ordinary game: seven columns, six rows, and the first player to line up four discs horizontally, vertically or diagonally wins. Clicking anywhere in a column drops a disc into the lowest empty slot, which is how the physical game works — so the whole column is the target rather than a small arrow above it, and the board works on a touchscreen without any precision. If a column is full, clicking it tells you so rather than doing nothing.

The computer searches for its own win first, then for yours, and otherwise plays a weighted preference for the middle columns with a random tiebreak. It does not look two moves ahead, which means it will happily build a position that lets you create two threats at once and then lose to one of them. That is a deliberate ceiling: a real solver plays Connect Four perfectly from the first move, and a game you cannot win is not a game. In computer mode you are red and you drop first.

How to use it

  1. Choose Computer or Two players. Switching starts a fresh board and leaves the record alone.
  2. Click anywhere in a column to drop a disc. It falls to the lowest empty slot in that column.
  3. In computer mode you are red and move first. In two-player mode red and yellow alternate on the same device.
  4. Press New game to clear the board, or Clear record to reset the win/loss/draw tally against the computer.

Common use cases

  • A game that takes longer than tic tac toe

    A full game runs a few minutes, which makes it a better fit for a real break than a game that ends in three moves.

  • Two people on one device

    Two-player mode needs no setup, and the turn indicator under the board keeps it clear whose go it is.

  • Playing on a phone

    The whole column is the hit area, so there is nothing small to aim at, and the board scrolls sideways only if it has to.

  • Trying to beat the computer

    The way to win is to build two threats at once. The computer blocks one of them and cannot see the other.

Frequently asked questions

How do I beat the computer?

Set up two ways to win at the same time. The computer checks for its own win, then blocks yours, but it only looks one move ahead — so if you can create two separate threats in a single move, it can only stop one of them.

Why does the computer like the middle columns?

Because the middle columns are genuinely stronger in Connect Four — a disc in the centre is part of more possible lines than one at the edge. Its preference is a set of weights rather than a rule, so it still plays elsewhere when there is a reason to.

Does the record include two-player games?

No. The tally is your record against the computer only. In two-player mode you are playing both sides, so those results would not mean anything and they are not counted.

What happens if the board fills up?

It is a draw, and it is counted as one in the record. On a seven-by-six board that takes forty-two moves and is rare, but it is possible.

Related tools