Five in a Row is the classic game also known as gomoku. The rules fit in one line: take turns placing stones and be the first to line up five. Because stones never move and are never captured, every stone you place stays useful or harmful for the rest of the game. That makes it a game about tempo. The player who keeps forcing the other to answer usually wins.

This guide explains how our version is set up, the shapes worth learning, how to build attacks your rival cannot stop, and how each level of the Bot picks its spot, including the blind spot that even Hard has.

The board and the rules this version uses

On most screens you play on a 15 by 15 grid. If the page opens on a narrow phone, under 480 pixels wide, you get a 13 by 13 grid instead. The size is picked when the game loads, so turning your phone sideways later does not change it. Columns are lettered from A, skipping I as traditional boards do, and rows are numbered, so the last move shows up below the board as something like H8.

Five dots mark the star points: one in the very center and four sitting on the fourth line in from each corner. They are handy landmarks for finding the middle and for describing positions to a friend.

The rules are freestyle. Five in a line wins, and so does six or more. There are no forbidden moves for the first player, which some tournament versions add to balance the game. Without those limits, the player who goes first has a real edge, so it is fair that the first move swaps every game.

Shapes you need to recognise

A four is four of your stones in a line that can still become five. If both ends are open it is an open four and it has two winning spots, so it cannot be stopped. If one end is blocked it is a closed four and must be answered right away, but one stone is enough.

A three that can grow into an open four is a live three. It does not have to be solid. A split three, like two stones, a gap, then one more stone, is just as dangerous, and beginners often miss it because it does not look like a line. When you see a live three, block it on your next move, and block on the side that also helps your own stones if you can.

Twos matter too, but more quietly. A good stone usually makes several twos in different directions at once. Those twos are the raw material that later turn into threes when you need a forcing move.

Openings and the first few stones

Open near the center. A stone in the middle can grow in all eight directions without hitting an edge, while a stone near the border has its lines cut short. If your rival opens in the middle, place your first stone right next to theirs, either straight beside it or diagonally touching it. Diagonal contact is slightly more popular because it blocks two of their directions while opening two of yours.

For the next few moves, keep your stones close, one or two steps from each other. Stones far apart do not share lines, so they never combine into a double threat. A compact cluster of four or five stones, arranged so that lines cross in several directions, is where almost every winning attack begins.

Do not rush to make a three early. A three you make too soon just invites a block that also helps your rival. It is often better to build two or three twos first, so that when you finally make a three, your next move can make another one in a different direction.

Forcing wins: four-three and three-three

The cleanest winning pattern is the four-three. One stone makes a four and a live three at the same time. Your rival must block the four, and then the three becomes an open four with two winning spots. A three-three works the same way: one stone makes two live threes, your rival blocks one and the other becomes an open four. Under freestyle rules both of these are allowed for either player.

Strong players often win with a chain of fours. Each four forces exactly one reply, so you get to place stone after stone while your rival can only answer. If the last stone in the chain also makes a three, it becomes a four-three and the game is over. Before each move, look for a four you can make where the forced block does not help your rival and your stone opens something new.

Defending works in the other direction. Whenever your rival has two lines that could both become live threes from one shared empty point, put your stone on that point first. Blocking the meeting point of two lines is far better than waiting and blocking each line separately.

How the Bot scores a spot

Every level uses the same basic idea. It only considers empty spots within two squares of a stone already on the board, and on an empty board it goes straight to the center. For each spot it looks at every stretch of five squares through it in all four directions, ignoring stretches your stones already spoil. A stretch where its stone would make one is worth 1 point, two is 12, three is 120, four is 2,000, and five is a winning million.

It then adds the same count for your stones, scaled down, so it also likes spots that ruin your best lines. Because a live three sits inside several open stretches at once, it scores far more than a closed three, so the Bot naturally reacts to real danger and ignores harmless shapes.

Easy, Normal and Hard, level by level

Easy counts your threats at only 55 percent of their value, shakes every score by a large random amount, and then picks among its top four ideas, choosing its favourite only about six times in ten. It does not check for an instant five first, so it can miss a win and can miss a block. A plain open three often gets through.

Normal always completes five if it can and always blocks your five, then plays its single best scored spot, with your threats counted at 90 percent and only a tiny random wobble. It does not look ahead at all. It usually blocks a live three because the score points it there, but it cannot see a move that sets up a double threat next turn.

Hard adds one step of lookahead. It takes its ten best spots and, for each one, checks two things: how many winning follow-ups it would have, and how strong your best reply would be. It loves moves that give it two ways to make five, and it avoids moves that leave you a big reply. That makes it good at finishing its own attacks and at closing your obvious ones.

Beating Normal and Hard

Both bots judge one spot at a time, and Hard only looks one move past that. Neither plans a sequence. So the way to win is to build a position where your next move creates a four-three or three-three, while every individual stone you place looks modest. Make twos that cross each other at a shared empty point, two steps apart in different directions. When the shape is ready, play the meeting point.

A chain of fours is also very strong against them. Each four is answered correctly, because a block of five is always checked first, but the bots do not see where the chain is going. If you can make three or four fours in a row, each forcing a single block, the last one often lands on a three as well.

On defence, remember that Normal and Hard attack readily, because your lines count slightly less than theirs. Answer every live three and every four at once, and look for blocks that also extend your own twos. When the Bot moves first, its opening stone always lands in the exact center, so be ready with your diagonal reply.

Playing a friend

In 2 Players mode you share one screen. Blue goes against orange, and the first move swaps each game, which matters a lot here because of the first-player edge. Playing best of two or best of four keeps it fair. On a keyboard, the arrow keys move a cursor around the board and Enter places a stone.

To play on two devices, press Play online at the top, host a party, send your friend the code and pick Five in a Row. No account is needed. If you enjoy reading lines across a grid, Four in a Row and Tic-Tac-Toe on this site use the same core idea with gravity and a tiny board.