GALAXY OF TOOLS

PLAY SECTOR

Four in a Row

Drop discs into a 7×6 grid and line up four. Play a friend or an easy-to-expert computer, with keyboard and touch.

0You
0Draws
0Computer

Your turn. You are red.

Tap a column, or use the arrow keys and Enter, or keys 1 to 7.

Left and right arrow keys move between columns; Enter, Space or the down arrow drops a disc; number keys 1 to 7 drop in that column. Red discs are solid, yellow discs have a ring.

Runs entirely in your browser. Nothing you enter or upload is sent to a server.

Free for everyone. If this tool saved you time, buy me a coffee.

Play four in a row online against the computer or a friend

This four in a row game is the classic drop-a-disc strategy game on a 7-column, 6-row grid. Red and yellow take turns dropping a disc into a column; it falls to the lowest free slot. The first player to line up four of their own discs horizontally, vertically or diagonally wins, and a full board with no line is a draw.

Play a friend on the same screen, or take on the computer at four levels from Easy to Expert. The computer searches ahead with minimax and alpha-beta pruning, so Hard and Expert look five and seven moves deep and rarely miss a tactic. Choose to play red and move first, or yellow and let the computer open. Your wins, losses and draws are kept in this browser.

It works with a mouse, a finger or a keyboard, and the winning four discs light up. For a smaller classic, try tic tac toe, which also has an unbeatable level, or chess for a deeper game.

How to use the Four in a Row

  1. Choose vs computer or Two players. Against the computer, pick a level and whether you play red (first) or yellow.
  2. Tap or click a column to drop a disc, or use the left and right arrow keys and Enter. Keys 1 to 7 also drop in that column.
  3. Try to line up four of your colour while blocking your opponent’s threes.
  4. Use Undo move to take back your last move (and the computer’s reply), or New game to start over.

Four in a Row features

Four computer levels

Easy plays a win if it sees one and otherwise mostly at random; Medium looks 3 moves ahead, Hard 5 and Expert 7, all with alpha-beta pruning.

Two-player mode

Pass the phone or share a keyboard. Red always starts, and the status line says whose turn it is.

Keyboard and touch

Large column targets, arrow-key navigation, number keys 1 to 7 and screen-reader announcements for every move.

Colour-blind friendly

Red discs are solid and yellow discs have a ring, so the two sides are told apart by shape as well as colour.

Undo and score tally

Take back moves, and keep a running count of wins, losses and draws for each mode.

Winning line highlight

The four connecting discs pulse when someone wins, so there is no argument about the line.

Strategy tips for four in a row

  • Play the centre column early. Centre discs sit on the most possible lines: a disc in column four takes part in more fours than one at the edge.
  • Look for double threats. Two separate ways to complete four at once cannot both be blocked, and this is how most games are won.
  • Watch what a drop gives away. If your move lets your opponent land on the square above, check that square is not a winning one for them.
  • Think in “odd and even” rows. As first player (red), threats on odd rows from the bottom tend to be stronger; as second player, even rows.
  • Block open threes at once: three in a row with both ends playable is a forced loss unless you can break it immediately.

How the computer thinks

Each level scores every possible reply by looking ahead a fixed number of moves. Wins and losses count as very large scores; otherwise the board is judged by counting lines of four that still have room to grow for each side, with a bonus for centre discs. Alpha-beta pruning skips branches that cannot change the result, so Expert can look seven moves ahead on a phone in a fraction of a second. Equal best moves are chosen at random so games differ. It does not use the game’s full solved database, so a perfect human can still beat Expert.

The rules at a glance

ItemRule
Board7 columns by 6 rows; discs fall to the lowest empty slot
TurnsPlayers alternate; red moves first
WinFour of your discs in a straight line: row, column or either diagonal
DrawAll 42 slots filled and no four in a row
Full columnA column with six discs cannot be chosen

Four in a Row FAQ

Can I beat the computer at four in a row?

Easy and Medium are beatable with basic tactics. Hard and Expert search deeper and punish mistakes, but they only look a few moves ahead, so a plan with a double threat can still beat them.

Who wins with perfect play?

Four in a row on a 7×6 board has been solved: the first player wins with perfect play, starting in the centre column. That takes exact play every move, which is why playing red and starting in the middle is a good habit.

How do I play with a friend on one device?

Choose Two players. Red goes first, then yellow, and the status line shows the turn. Taking turns on a phone or tablet works well.

Can I take back a move?

Yes. Undo move removes your last move and, against the computer, its reply as well. A finished game can be undone to try another line.

Does it work with the keyboard only?

Yes. Use the arrow keys to move between columns and Enter or Space to drop, or press 1 to 7. Moves are announced for screen readers.

Is my score saved?

Scores are stored in this browser only, separately for computer and two-player games. Reset scores clears them. Nothing is sent to a server.

You might also need