Gomoku
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Rules of Gomoku

How to play, how to win, and the exact rules used on this site

The rules in five points

  1. Two players, X and O. X always makes the first move, then the players alternate, one stone per turn.
  2. Place a stone on any empty cell. There are no restrictions on where you may play.
  3. Stones stay where they are. Nothing is moved, captured or removed for the rest of the game.
  4. Five in a row wins. The first player with five of their own stones in an unbroken line - horizontal, vertical or diagonal - wins immediately.
  5. A full board is a draw. If every cell is filled and nobody has five in a row, the game is drawn.

What counts as a winning line

The five stones must be next to each other with no gaps and no opposing stone between them. Lines can run in four directions: across, down, and along either diagonal.

X wins with five in a row across the middle. X's diagonal has only three stones, and O's diagonal is interrupted by an X stone, so neither of those is a winning line.

On this site a line of six or more also wins. This is the “freestyle” rule. Some tournament rule sets require exactly five and treat longer lines (called overlines) as nothing special; those differences are explained on the rule sets page.

Rules used on Gomoku Online

RuleHow it works here
Who moves firstX. Against the computer you are always X and the computer is O.
Winning lineFive or more in a row in any of the four directions.
Forbidden movesNone. Double threes, double fours and overlines are all allowed for both players.
DrawDeclared when the board is completely full with no winner.
Square boards10×10, 15×15 and 20×20.
Special boardsTriangle (10 rows, 100 cells) and Cheese (12×12 with 10 random holes). See Boards.
Time limitNone in local games. An online game is abandoned after five minutes without a move.

Game modes

  • vs CPU - you play X against the computer at Easy, Medium or Hard difficulty. The computer replies as soon as you move, and its last stone is highlighted so you can see where it played.
  • vs Player - two people share one screen and take turns. The status line above the board shows whose move it is.
  • Online - you create a room and get a link. Send it to a friend; when they open it, the game starts. The player who created the room is X. No account is needed for either player.

Common beginner questions about the rules

  • Do I have to play next to another stone? No. Any empty cell is legal, although playing far from the action is rarely useful.
  • Can a line bend or wrap around the edge? No. A line is straight and stops at the edge of the board.
  • Does one stone count for two lines? Yes. A stone can be part of a horizontal line and a diagonal line at the same time. Using one stone for two threats is the heart of the game - see strategy.
  • Is there an advantage to moving first? Yes, a significant one. With no restrictions on the first player, strong play by X is very hard to stop. The openings page shows a simple way to even this out when two people play on one device.

Try it - start a game