Logic puzzle · Outsmart the boardConnect 4,
Connect 4,
four in a row.
Drop a chip. Block your rival. Win the diagonal.
- Turn
- Idle
- Wins
- 0
- Losses
- 0
- Draws
- 0
ReadyConnect Four
Connect Four
outsmart the AI.
Click a column or press 1–7 · Space pauses · Enter starts
About the gameHow Connect 4 works,
How Connect 4 works,
in short.
- Step 01
Drop a disc.
Pick a column. Your disc falls to the lowest empty slot under gravity. Players alternate turns.
- Step 02
Stack and counter.
Each turn you add one disc. Read the board: build your own line, block your opponent's.
- Step 03
Four in a row wins.
Connect four of your discs in a row — horizontal, vertical, or diagonal — and the game is yours.
Questions
Connect 4 questions, answered.
Connect 4 is a two-player strategy game on a 6-row by 7-column vertical grid. Players take turns dropping pieces into columns. The first to line up four pieces in a row — horizontally, vertically, or diagonally — wins.
Click or tap a column to drop your red piece; it falls to the lowest empty cell. The AI then drops a yellow piece. Keep alternating until someone connects four in a row or the board fills up for a draw.
The AI uses a minimax search with alpha-beta pruning and a preference for the center column. Easy plays a shallow search with occasional random moves, Medium looks four moves ahead, and Hard keeps searching deeper for a fraction of a second each turn — usually eight to fourteen moves ahead. When several moves are equally good it picks between them at random, so the same opening will not always get the same reply.
Control the center column — it touches more winning lines than any other. Look for double threats where one move creates two ways to win at once. And always think about the row above your move; dropping a piece can hand the opponent a winning slot on top.
Any four-in-a-row counts, including diagonals going up-left to down-right or up-right to down-left. Diagonal threats are the easiest to miss, so scan every direction before each move.
Yes. If all 42 cells fill up without either player connecting four, the game is a draw. Solved play between two perfect players actually favors the first player, but mistakes by either side often lead to draws.
Yes. Your record against each difficulty level is saved in your browser so you can see how you improve over time. Clear your browser storage to reset the stats.
More to play