Connect Four
Drop your discs and line up four before your opponent.
The great classic of the 7 × 6 vertical grid. At Master level, the AI relies on a precomputed opening book and solves the game as soon as it can.
- Players
- 1 or 2 players
- Length
- 5 min
- Against the AI
- Two players on one device
15 days of full access, no account · No download

How to play
Goal
Two players take turns dropping a disc of their colour into one of the seven columns of a vertical grid with 6 rows. The disc falls to the lowest empty square. The first to line up four discs horizontally, vertically or diagonally wins.
How it works
- The gold disc always goes first.
- A full column can no longer take a disc.
- If the grid fills up with no line, the game is a draw.
- Click or tap a column; on the keyboard, keys 1 to 7, or arrows then Enter.
About the AI
The engine represents the grid with bitfields and explores moves with the negamax algorithm (alpha-beta pruning, transposition table, threat look-ahead). Its evaluation takes into account the position of the discs, the threats and their parity.
At Master level, the AI first consults an opening book computed offline by an exact solver, then solves the game mathematically as soon as possible: if it has a winning position, it does not let it slip. The lower levels search less deeply and deliberately add inaccuracies.
AI levels
- BeginnerLooks two moves ahead and is often caught by surprise.
- AmateurSees simple threats, but lacks a plan.
- IntermediateCalculates seven moves ahead: a solid opponent.
- ExpertDeep search and careful reading of threats.
- MasterOpening book, exact solving and deep search: nearly perfect.
