Gomoku — five in a row
Get five stones in a line before your opponent does.
Black · you
White · computer
Moves: 0Your move
Your record (Medium): Won 0Lost 0Drawn 0
Click a point, or move with the arrow keys and press Enter.
Nothing leaves your device
This tool runs entirely in your browser. What you type, play or record here stays on your device: nothing is uploaded or saved on a server.
Example
Five or more, or exactly five: the same eleven moves, two different endings
Two players on one screen. Points are named as the game names them for keyboard play: columns A to O from the left, rows 1 to 15 from the bottom, so the centre is H8. After nine moves Black has F8 G8 H8 and J8 K8 along row 8, with a gap at I8, and White holds E8 at the left end.
- Under “Five or more wins”, I8 joins F8 to K8 into six, and six wins. White must take I8 at move 10; the computer does at every level, as it always stops a line that would win.
- Under “Exactly five wins”, six in a row is an overline and does not count. I8 is then no threat, and the computer playing White spends its move 10 somewhere else.
- If Black plays I8 anyway under that rule, nothing is marked: the game goes on with White to move.
| Move | Stone | Point | On the board |
|---|---|---|---|
| 1 | Black | H8 | first stone in the centre |
| 2 | White | H9 | right above it |
| 3 | Black | G8 | two in a row |
| 4 | White | E8 | closes the left end early |
| 5 | Black | F8 | F8 G8 H8 |
| 6 | White | G7 | below the row |
| 7 | Black | K8 | a stone further along row 8 |
| 8 | White | J9 | above row 8 |
| 9 | Black | J8 | F8 G8 H8, gap at I8, J8 K8 |
| 10, five or more | White | I8 | forced: I8 would give Black six |
| 10, exactly five | White | elsewhere, e.g. G9 | I8 is no threat under this rule |
| 11, exactly five | Black | I8 | six in a row, F8 to K8: no win |
Same stones, different results. Under “Five or more wins” a gap that would make six is a winning point to block; under “Exactly five wins” only a gap that makes exactly five is. Choose the rule before the first stone.
How it works
- Choose the computer and its level, or a friend, and the rule; black plays first.
- Take turns placing a stone on an empty point of the 15 × 15 board.
- The first to make five in a row — across, down or diagonally — wins.
Frequently asked questions
- What are the rules of gomoku?
- Two players take turns placing black and white stones on the intersections of a 15 × 15 grid. The first to get five of their stones in an unbroken line — horizontal, vertical or diagonal — wins.
- What is the difference between the two rules?
- With “five or more”, a line of six or more also wins. With “exactly five”, a line longer than five doesn’t count — the classic rule in many tournaments.
- How do I beat the computer?
- Watch for open threes — three in a row with both ends free — and block them early. Build two threats at once, such as a four and an open three, so the other side can’t block both.
- Can I play on a phone?
- Yes — on a small screen tap once to mark a point and again to place the stone, so a slip doesn’t cost the game.
- How strong are the three levels?
- Easy always takes a winning point and blocks yours, but otherwise plays one of a few good points or simply somewhere near the stones. Medium plays the strongest point for itself or against you. Hard also stops every open three and four and looks ahead for about two-thirds of a second a move, so beating it takes a double threat.
- Does Black have an advantage?
- Yes. Black moves first, and in plain five in a row on a 15 × 15 board that is a real edge: it has been shown that Black wins with perfect play. This game adds no restrictions on Black, as renju does, so take turns at Black, or let the computer play Black when you want a harder game.
- Is anything sent anywhere?
- No. The game runs in your browser and your record stays on this device.
Related tools
◑ Reversi Trap a line of discs between two of yours and flip them all. # Tic-tac-toe Three in a row wins — can you beat the unbeatable level? ♞ Chess A full game of chess against the computer or a friend — no account needed. ∷ Sudoku online A fresh puzzle at your level — notes, hints and undo included.