Faveden

Four in a Row

By Kenrick

Drop discs, line up four, and pick how far ahead the computer looks.

  • Board
  • 3–5 min
  • Computer and phone

Play now

About 12 KB to download

About this game

Four in a Row is a two-player board game you play against the computer in your browser. Take turns dropping discs into a seven-column grid; the first to line up four in a row, column or diagonal wins. The computer plans by searching ahead: two turns on Easy, four on Normal and seven on Hard.

How to play

  1. Choose a mode in the start dialog: against the computer, two players on one device, or watch the computer play itself. Against the computer, also choose Easy, Normal or Hard.
  2. On your turn, pick a column. Your disc drops to the lowest empty space in it.
  3. Line up four of your discs across, down or diagonally to win.
  4. If the board fills up with no line of four, the game is a draw.

Controls

InputAction
Click or tapDrop a disc in a column
Keys 1 to 7Drop a disc in that column
Tab, then EnterReach the column buttons and choose one

Screenshots

The seven-column board after one move each: the player’s red disc in the middle column and the computer’s blue disc beside it.

AI in this game

  • Search AI
Search AI

Minimax search with alpha-beta pruning and a hand-written evaluation, run in your browser. Faveden added a strength choice: search depth 2 (Easy), 4 (Normal, the original setting) or 7 (Hard). The status line shows when it is thinking.

How we label AI

How this game was made

  • Original game: c4 by Kenrick, published under the MIT License.
  • Faveden renamed it, removed its online mode and outbound links, and added a strength choice and a thinking status. Every change is listed in the package's PROVENANCE.json.
  • Reviewed by Faveden before listing: licence check, source review, and automated play tests in Chrome and Safari engines.

Ratings and reviews

Loading ratings…

Comments

Loading comments…

More games like this