▶ PlayHub

Gomoku

Five in a row, before the machine.

Turn—
Moves—
Stones—

Click an intersection to place a black stone. Five in a row wins, in any direction, and the computer answers in under a second.

Gomoku in play: Five in a row, before the machine
Gomoku mid-round, captured in a browser at 1200×630.

How to play

Also called five in a row. Black and white alternate on a 15 by 15 grid, and the first player to line up five stones horizontally, vertically or diagonally wins. You play black and move first, which in Gomoku is a real advantage that the computer spends the whole game trying to take away.

You play black and move first. Each turn you place one stone on any empty intersection; stones never move and are never removed. The first player to get five of their own stones in an unbroken line wins the game. The line can run horizontally, vertically or diagonally, and it can be longer than five: six or seven in a row still counts.

The tactics come from threats you can build. Three stones in a row with both ends open is an open three, which cannot be blocked on both sides, so it wins on the next move. Four stones with one open end is a four, which forces an immediate block. The computer scores every empty point near the action for exactly these patterns, for both colours, and plays whichever point scores highest for itself while denying you the same shape.

That means the game is a race of forcing moves. If you can create two threats at once, a four and an open three, one of them will win because the computer can only answer one. If you spend moves building shapes that do not threaten, the computer will finish its own open three first. Undo removes your last stone and the reply, so you can test a line and take it back.

Strategy that actually helps

  • Open with the centre. A stone four intersections from every edge has more directions to grow in than one near the wall.
  • Build outward from a single cluster. Stones scattered across the board threaten nothing; four in a line with room to extend threatens everything.
  • Create double threats. A four plus an open three, or two open threes, cannot both be answered, which is how most games are actually won.
  • Block the open three immediately. If the computer has three in a row with two open ends and you do not block one of them, it wins on the following move.
  • Keep your threats diagonal as well as straight. Players watch rows and columns; diagonal fours are the ones that get missed.

Questions

Exactly five, or five or more?

Five or more. Any unbroken run of five or longer stones in one of the four directions wins. Unlike Renju, there is no rule against overlines here, which keeps the game readable for casual play.

Who moves first?

You do, as black. In serious Gomoku black s first-move advantage is large enough that tournaments use opening restrictions. Here the computer compensates by reading your threats aggressively, which is why careless opening moves get punished quickly.

How does the computer choose its moves?

It rates every empty point near the existing stones. For each candidate it counts the shape it would create for white and the shape it would deny black, in all four directions, then plays the highest total. It also takes an immediate win or blocks an immediate loss before anything else.

Can I take back a move?

Yes. Undo removes your last stone and the computer reply, returning the turn to you. Press it repeatedly to step back through the game; the move counter follows along.