Four in a Row Unblocked

Take turns dropping discs into a standing grid and be the first to link four of your color.

Four in a Row is a two-player strategy game on an upright grid seven columns wide and six rows tall. If you are looking for Four in a Row unblocked for a school laptop, this version runs right in the browser against a friend on the same screen or a computer opponent with three strength levels. The rules fit in one sentence, but good play means reading threats several turns ahead, and that is what keeps rounds tense.

How to Play Four in a Row

Black always moves first. On your turn you choose one of the seven columns, and your disc drops to the lowest empty slot in it. You do not need to aim at the top: clicking or tapping any cell in a column picks that column. The open landing spots are lightly marked, so you can see where each disc would end up.

A column that already holds six discs is full and can’t take more. After every drop the game checks for four touching discs of one color in a straight line. Horizontal, vertical and both diagonal directions all count. The first player to make one wins, and a full board with no line is a draw.

Your First Round, Step by Step

  1. Pick 2 Player (local) to share the device with a friend, or vs Computer to play alone.
  2. Against the computer, choose your disc color and a level, then press New game. Choosing black means you open; choosing white lets the computer go first.
  3. Drop your opening disc in the middle column. Watch where the reply lands.
  4. Keep an eye on the status line. It says whose turn it is and announces the result.
  5. Use Undo if you misclick. Against the computer it rolls back to your own last turn, removing the computer’s reply too.
  6. Resign ends a round you can’t save. The game asks you to confirm before resigning or starting over, so a stray click won’t wipe the board.

The Three Computer Levels

The levels behave very differently, and the code shows exactly how:

  • Easy chooses a random legal column every turn. It will often ignore your three-in-a-row, which makes it ideal for learning the shapes.
  • Medium scores each possible drop by looking at every group of four cells on the board. It rewards its own threes and twos, weighs blocking your threes slightly more than building its own, and likes the center column. Then it picks at random among its top three choices, so it is solid but beatable.
  • Hard searches the move tree with alpha-beta pruning, deepening step by step up to eight moves ahead. It checks central columns first and prefers faster wins. It plays very few loose moves.

There is also an optional Suggest difficulty checkbox next to the level menu. When it is on, three wins in a row nudge the level up one step and three losses in a row nudge it down, with a short note explaining the change.

Four in a Row Strategy That Works

These habits will win you more rounds against people and the Medium level, and keep you alive longer on Hard:

  1. Start in the center. The middle column touches more possible lines of four than any other, which is also why the computer values it.
  2. Build two threats at once. One open three gets blocked in a single turn. Two separate winning cells mean your opponent can stop only one.
  3. Don’t fill the cell under a threat. If your rival needs a specific empty spot to win, avoid dropping a disc directly beneath it. You would hand them a ledge to land on.
  4. Count in pairs of columns. Before you drop, ask where your opponent’s reply would land in that same column. Many losses come from the disc that lands on top of yours.
  5. Watch the rows late in the game. As the grid fills, a threat on an odd row (first, third, fifth from the bottom) tends to favor the player who went first. The second player usually wants threats on even rows.
  6. Play white against the computer sometimes. Defending from the second seat is harder, and it teaches you which shapes to fear.

Mistakes New Players Make

The most common slip is staring at horizontal lines only. Diagonals are easy to overlook, both your own and your opponent’s, so scan them before every drop.

Another is blocking too late. When your opponent has two discs with open space on both ends, a single block may not be enough. Deal with it while it is still a two.

Finally, many players fill the edge columns early. Discs on the sides take part in very few lines, so save those columns for forced moves.

Playing on a Chromebook, Tablet or Phone

The board stands upright, so it fits a phone held in portrait well. Touch, mouse and keyboard all work: the arrow keys move between columns and Enter drops a disc. Your round in progress is saved locally, so closing the tab between classes is fine on the same browser.

The Settings menu holds a few useful options. You can enlarge the text, turn on high contrast, change the spacing, and set the computer’s thinking pause to Fast, Normal or Slow. A “Who moves first” option can also randomize your color at the start of each game against the computer.

Who It Suits and What to Play Next

A round takes only a few minutes, so it works for a short break with a friend at the next desk. Playing the Hard level is a better fit for a longer sit, since each game rewards slow thinking.

If you enjoy it, more games are waiting in board and card games:

  • Gomoku asks for five in a row on a much bigger open board, with no gravity pulling pieces down.
  • Reversi is about flipping your opponent’s pieces instead of lining yours up.
  • Checkers trades lines for captures, jumps and kinged pieces.

Quick facts

Devices
Phone, tablet & computer
Controls
Mouse, Touch, Keyboard
Players
1–2 players
Price
Free, no sign-up
  • board game
  • two player
  • strategy
  • discs
  • computer opponent

How to control Four in a Row

ActionKeyboardMouseTouch
Drop a discArrow keys to reach a column, Enter to dropClick any cell in the columnTap any cell in the column
Pick a game mode—Click "2 Player (local)" or "vs Computer"Tap "2 Player (local)" or "vs Computer"
Start a game against the computer—Choose a disc color and level, then click "New game"Choose a disc color and level, then tap "New game"
Take back your last move—Click "Undo"Tap "Undo"
Give up the current game—Click "Resign"Tap "Resign"

Made by

Christopher Müller

Code license
MIT
Art & sound
MIT (grid and discs drawn with CSS, no image or audio files)

Four in a Row questions

Can I play Four in a Row on a Chromebook?

Yes. It runs in the browser with no download, and you can click cells with a mouse or touchpad, tap on a touch screen, or use the arrow keys and Enter.

How do you win Four in a Row?

Line up four of your own discs with no gaps, either across a row, up a column or along a diagonal. If all 42 spaces fill first with no line of four, the round is a tie.

How strong is the Hard computer?

Hard runs a real game-tree search that can look up to eight moves ahead within a fixed thinking budget. It almost never misses a threat you leave open, so expect to lose a few rounds while you learn.

Does Four in a Row save my game and record?

An unfinished round is stored in your browser and comes back after a reload. Wins, losses and draws against the computer are also counted locally; two-player rounds are not added to that record.

Is Four in a Row free?

Yes, it is free to play with no account. The game is open source under the MIT license, and the board and discs are drawn with plain CSS.

More board & card games

See all →