Connect Four

You're red, the computer is yellow. Click a column to drop a piece.

Your move

Four in a row, against a real opponent

Drop pieces into a column and try to connect four in a row — horizontally, vertically, or diagonally — before the computer does. The AI actually plays to win and block, not just randomly, so it's a real game, not a formality.

A solved game — and what that means for strategy

Connect Four was mathematically solved in the late 1980s: with perfect play, the first player can always force a win, and the single strongest opening move is the center column, since it's part of more possible four-in-a-row combinations than any other column. That doesn't make winning automatic — this AI can still be beaten, and beaten more consistently once you're deliberately starting center and watching for the moment it needs to block you rather than just reacting move by move.

Thinking two moves ahead, not one

The biggest jump in skill against any Connect Four opponent, human or computer, comes from checking every move for a "double threat" before making it — a position where dropping one piece creates two different winning spots at once, which can't both be blocked in a single response. Consistently setting up double threats rather than single obvious ones is close to the entire difference between a beginner and a strong player at this game.

Why vertical and diagonal wins get missed

New players tend to fixate on horizontal rows since they're the most visually obvious, which means vertical stacks and diagonal lines are the most commonly missed win conditions — both for spotting your own winning move and for noticing the opponent is one move from theirs. Actively scanning all three directions after every single move, not just the row you're currently building, closes off the most common way games get lost unnecessarily.