Four in a Row – Play the Computer at 3 Strength Levels
Drop discs into a 7-column, 6-row grid and be the first to line up four of your own discs horizontally, vertically or diagonally. Pick one of three computer levels and choose whether you move first or second. The winning four are highlighted, and undo lets you practice. Looking for another board game? Try Reversi.
🔒 Runs in your browser · Your data is never sent to a server
- Red
- Yellow
How to use
- Choose the computer level (Easy, Normal or Hard) and your side (first as red, or second as yellow). A new game starts when you choose.
- Click (or tap) a column arrow above the grid, or any square in a column, to drop a disc to the lowest free spot.
- Line up four of your discs horizontally, vertically or diagonally to win. The winning four are highlighted. If the grid fills up, the game is a draw.
- Press "Undo" to take back a move, or "New game" to start over.
Notes
- Everything runs in your browser and nothing is sent to a server. The computer’s moves are also calculated in your browser.
- The computer is a simple engine that looks a few moves ahead (up to 7 on Hard). It is not a perfect solver.
- Easy picks a random open column. Normal looks 4 moves ahead and Hard looks 7.
- When several moves score equally, the computer picks one at random, so the same position will not always play out the same way.
- Undo takes back your last move together with the computer’s reply. Game progress is not saved; reloading the page starts a new game.
- With a keyboard, Tab to the column arrow buttons and press Enter or Space to drop a disc.
Glossary
Four in a Row
A two-player game on a 7-column, 6-row grid. Players take turns dropping discs, which fall to the lowest free spot in a column, and the first to line up four of their own discs in any direction wins.
First / second player
The first player moves first. The center column takes part in the most possible lines, so starting there is generally considered strong.
Double threat
A position where you can win at two different spots on your next move. Your opponent can block only one, so the game is almost decided.
FAQ
What are the board size and the rules?
The grid has 7 columns and 6 rows. Red and yellow discs are dropped in turn and fall to the lowest free spot in the chosen column. The first to line up four of their own discs horizontally, vertically or diagonally wins; if the grid fills up, it is a draw.
What is the difference between the computer levels?
Easy picks a random open column. Normal looks 4 moves ahead and Hard looks 7, favoring the center column and open threes. Even Hard does not search the whole game, so creating a double threat can beat it.
Is going first an advantage?
On the standard 7×6 grid, the first player can force a win by starting in the center column and playing perfectly. In practice that is hard to do, and this computer is not perfect, so you can win as the second player too.
How far back can I undo?
Undo removes your last move and the computer’s reply and returns the turn to you. You can press it repeatedly to go all the way back to the start of the game.
Is my game saved?
No. A game lasts only while the page is open; reloading starts a new one. The tool runs entirely in your browser and sends no data to a server.
Share this page
