Four in a Row
Connect four in a row first — vs AI or two players.
What is this?
Four in a Row is played on a 7×6 board where two players alternate dropping discs into columns. The first to line up 4 discs in a row — horizontally, vertically, or diagonally — wins. Use the Mode control to play vs AI (against the computer) or 2 players (two people taking turns on one device).
How to play
Click any column to drop a disc into its lowest empty cell. In vs AI you play Red and the computer replies with Yellow automatically; in 2 players both people alternate placing Red and Yellow. The game ends the moment either side completes 4 in a row. Use Undo to take back the last move (two discs vs AI, one in 2 players), or New game to restart. Changing the mode starts a new game.
How does the computer AI play?
The computer uses minimax search with alpha-beta pruning to look several moves ahead and pick the strongest column. Higher difficulty searches deeper for sharper play. It immediately blocks the opponent's winning move and prioritizes completing its own.
Privacy
Game progress is shown only in your browser and is never sent to or stored on a server.