Four in Line
Seven columns, six rows, and a search that would rather block you than build
About Four in Line
Four in Line is a two-player board game on a grid seven columns wide and six rows deep. On your turn you drop a disc into a column and it falls to the lowest empty slot. Line up four of your own colour — along a row, up a column, or on either diagonal — and the round is yours. Fill all forty-two slots without a line and it is a draw.
The reason the single-player side holds up is the opponent. It runs a proper minimax search with alpha-beta pruning rather than a list of hand-written rules, and the three settings change only how deep it looks: two ply on easy, four on normal, six on hard. Six ply is enough to see the trap you are three moves from setting, and it will quietly step around it.
Red always moves first, and in single player coral is you. Rounds last a couple of minutes at most, and the tally at the top keeps count across them, which is how the game is meant to be played: as a series rather than one board.
What is different about this version
The evaluation function is lopsided on purpose, and you can play against that. A four-cell window holding three of the computer discs and one gap is worth 50 to it; the same window holding three of yours is worth minus 80. Defence outweighs offence by a clear margin, so the search will abandon its own developing line to shut down yours, and a threat you never intend to complete still buys you a move somewhere else.
It also opens sensibly because of how the search is ordered: columns are tried centre-first, which prunes the tree faster and happens to look like textbook play. Easy at two ply sees your immediate reply and nothing past it, so it blocks obvious wins and never sets a trap.
How to play Four in Line
- Choose the computer on easy, normal or hard, or a second player on the same device.
- Click or tap a column. Your disc falls to the lowest free slot in it.
- Get four of your colour in a line — horizontal, vertical or either diagonal — to take the round.
- If all forty-two slots fill with nobody connecting four, the round is drawn and the tally carries on.
Controls
| Desktop | Hover a column to see a preview disc drop into the exact slot it would land in, then click to commit. |
|---|---|
| Phone or tablet | Tap the column you want and the disc falls to the lowest free slot in it. |
| Players | One or two people on the same device. Nothing here plays over the internet. |
Strategy
The middle column is worth more than the others because more four-in-a-row windows pass through it than through any other file, and the computer knows this — it scores its own centre discs explicitly. If you are moving first, the centre is the opening. If you have let it take the centre, expect to spend several moves on the back foot.
Because discs stack, every move you make also builds a platform. Before dropping, look at the square immediately above the one you are filling and ask what it completes for the other colour. Half the games lost at this size are lost by blocking a three and handing over the square directly on top of the block.
Single lines do not beat the six-ply search. Two do. Build a position where one drop creates two separate places you can finish, because it can only cover one. The lopsided evaluation gives you the tempo: point a three at it somewhere harmless, watch it spend a move killing that, and use the free move to build the real fork elsewhere. On easy this is overkill — a two-ply search walks into almost anything — but on normal it is the reliable route and on hard it is the only one. Keep an eye on how full the board is getting as well — a fork that needs two more rows underneath it will never happen in a board this shallow, and it is worth abandoning early for something that lands.
Mistakes that cost you the game
- Opening on an edge column. A disc in the outermost file belongs to fewer possible lines than one in the middle, and the deficit compounds for the rest of the board.
- Blocking without checking the square above the block. Stopping one line by building the other side's ladder is the most common way a won position turns.
- Committing to a single line and defending it. Against four or six ply, one threat always gets covered; the win comes from the second one.
Tips
- Take the middle column on your first move whenever it is free.
- Count the empty slots below a square before planning a line through it.
- Use the landing preview on desktop; it stops you dropping one row off from where you pictured it.
- Put a harmless three on the board when you need a tempo.
- If hard is grinding you down, drop to normal. Four ply to six is a bigger step than two to four.
Questions about Four in Line
Who moves first?
Coral does, and in single player coral is you. At this board size moving first is a real advantage.
What changes between the settings?
Only search depth: two ply on easy, four on normal, six on hard. The position evaluation is identical at all three.
Can two people play?
Yes, taking turns on one device. There is no online matchmaking here.
Does the score carry over?
Yes, the tally tracks wins for both colours across the session. A draw leaves it untouched.
Is hard beatable?
Yes, but only with a double threat. Single lines always get covered at six ply.
Does it cost anything?
No. Four in Line is free to play, runs in your browser, and needs no download, install or account.
More games like this
-
Bigger Tic Tac ToeNine small boards inside one big one, and your square picks where your opponent plays
-
ChessEvery rule of chess, and an opponent that never looks at your reply
-
Tic Tac PushA 5x5 board, two walkers, loose blocks — shove three of your mark into a line
-
Ant ColonyEight ants underground, sixteen duties to finish, and one of them is not an ant