Games

Four In A Row

Drop tokens into columns. They stack from the bottom. First to four in a row — horizontal, vertical, or diagonal — wins. Play vs. me at four difficulties, or 1-on-1 over a peer-to-peer room with a friend.

Controls

Play Solo
LevelTakeover AI level
0 vs 0

Four In A Row board

Your move (blue).

Actions

Status

Chat

About this page

The computer player is an alpha-beta minimax search over a position-evaluation function: it counts how many three-in-a-rows each side has with an open fourth cell, weights central- column control (the centre column is provably the strongest opening), and looks two, four, six, or nine moves ahead at the four difficulty levels. Search runs in a Web Worker so the UI stays responsive while the engine thinks.

Friends mode is a peer-to-peer 1-on-1 game over WebRTC, brokered by a public signaling service for the initial handshake only. No accounts, no server-side game state, no app install. The host's browser is authoritative; both peers render from snapshots. Spectators get a read-only view.

Nothing leaves your browser. The game, your move history, and your win/loss stats stay local. Per-difficulty stats are kept in your browser's localStorage; clearing site data resets them. No accounts, no leaderboards, no telemetry beyond the site-wide page-view counter.

The four-in-a-row format is commonly called by another, trademarked name. This page uses the descriptive name throughout to keep clear of that mark, and the colour scheme (blue tokens vs. red on a deep-blue frame) is the site palette rather than the toy's.

How to play

The board. Seven columns by six rows. Tokens drop into a column and stack from the bottom — you can't place mid-column. You play blue; the computer (or your opponent in Friends mode) plays red.

Taking a turn. Click any column. The token slides down to the lowest empty cell in that column. On mobile, tap the column header strip above the board or anywhere inside the column.

Winning. The first player to align four of their own tokens in a row — horizontally, vertically, or diagonally — wins. The four winning tokens pulse to show you exactly which line scored.

Drawing. If the board fills up with no four-in-a-row, the game is a draw. Neither side's score changes in a multi-game match.

Difficulty. The Level chips control the computer's search depth: Easy looks 2 moves ahead, Medium 4, Hard 6, Expert 9 with iterative deepening. Higher levels take longer to respond.

First move. The first mover has a theoretical winning strategy under perfect play. The First-move toggle lets you hand the opening to the computer if you want a tougher game.

Hint. The Hint button highlights the column the engine would play if it were you, at the current difficulty. It never drops the token for you.

Undo. Undo backs up your last move and the computer's reply together, returning to the position before your last decision. Hint and Undo are Solo-only.

Score by difficulty

Easy 0 games
No games yet
0 wins · 0 losses · 0 draws

0-game win streak

Medium 0 games
No games yet
0 wins · 0 losses · 0 draws

0-game win streak

Hard 0 games
No games yet
0 wins · 0 losses · 0 draws

0-game win streak

Expert 0 games
No games yet
0 wins · 0 losses · 0 draws

0-game win streak

Room

Seats

Watching 0

No one is watching right now.

Last refreshed 2026-05-27 by Callisto — new page; slotted frame; richer Scores tab.