Puzzle · Strategy

Connect 4

Drop discs into the grid and connect four in a row in this classic strategy game.

Overview

Drop a disc into a column and gravity does the rest. Connect 4 is the two-player staple where each turn sends a colored piece sliding down one of seven columns to rest at the lowest open slot, and the first side to line up four of their own — across, up and down, or on either diagonal — wins. The rules fit on a napkin, which is exactly why the game has depth: with only seven columns to choose from, every placement commits a row and denies the opponent a square at the same time, and competent play turns the board into a working memory of threats stacked on top of threats. This build supports two-player hotseat play and a computer opponent, so you can sharpen tactics against the AI before sitting across from a friend. Games are short, decisions compound quickly, and a single wasted move in the middle columns is often the difference between forcing a win and getting forked into defending two threats at once. The diagonal lines are the quiet killer — horizontal and vertical threats are easy to spot, but the diagonals hide in plain sight and decide most games between evenly matched players.

How to Play

Pick a column and drop your disc. The keyboard maps arrow keys to column selection, with Enter or Space releasing the piece; the mouse lets you click any column to drop straight in; touch does the same with a tap. Each disc falls to the lowest empty slot in that column, and turns alternate between the two colors. The win condition is four of your discs aligned in any straight line — horizontal, vertical, or diagonal. Switch between two-player mode and the AI opponent from the menu, and the controls stay identical whichever side you sit on. There is no clock, so the entire input loop is reading the board and choosing a column.

Tips & Strategy

Control the center column. Every disc played in the middle contributes to more potential lines than a disc on either edge, because center pieces reach across more diagonals and more horizontal runs, so competent play treats column four as contested ground for the first several moves. Look for what is sometimes called an odd or even threat — a column where your piece will complete four on a specific row — and notice when your opponent is building two simultaneous threats that share no single blockable square, because that fork is how most losses actually happen. Defend proactively rather than reactively: blocking a three-in-a-row is obvious, but strong players spot the threat one move earlier and occupy the slot that would have completed it. When playing the AI, test whether it punishes center neglect, and if it does, treat the opening as solved — claim the middle, build overlapping threats off it, and force the defense to commit before you do.

Controls

Keyboard
Arrow keys to select columnEnter or Space to drop disc
Mouse
Click to drop disc in column
Touch
Tap to drop disc in column

Features

  • Classic Connect 4 gameplay
  • Two-player mode
  • AI opponent
  • Strategic gameplay
  • Simple rules, deep strategy

Frequently asked questions

How do I win at Connect 4 against the computer?

Control the center column, set up double threats where two winning lines cross, and look three moves ahead so the opponent cannot force a win.

Can two people play Connect 4 here?

The browser build plays against the AI. To face a friend, take turns at the same keyboard on the same board.

Does going first matter?

Yes. With perfect play the first player can force a win in Connect 4, so taking the opening move is a real advantage.