Gomoku is the classic five-in-a-row game: two players take turns placing black and white stones on the crossings of a grid, and the first to line up five wins. It's also known as five in a row, Gobang, and omok. Here it's played on the standard 15×15 board under freestyle rules, against a computer with three levels or a friend sharing your screen.
Gomoku rules: five in a row wins
A Gomoku board has 15 lines each way, which makes 225 points where the lines cross. Stones go on those crossings, not inside the squares. Black moves first, and from then on the players alternate, each placing one stone on any empty point. Stones are never moved or captured, so every stone stays in play until the end.
The first player to make an unbroken line of five stones across, down, or diagonally wins, and a line is drawn through the winning stones. If all 225 points fill up with no five, the game is a draw.
Freestyle Gomoku, Renju, and other rule sets
This Gomoku game uses freestyle rules: five or more in a row wins, so a line of six counts too. Freestyle is the simplest set of rules and a common choice for casual games.
Other rule sets exist because moving first is a big advantage. Standard Gomoku counts only exactly five, so a line of six doesn't win. Renju, a tournament form of the game, forbids Black from making two open threes at once, two fours at once, or a line longer than five, and adds special opening rules. Those variants aren't offered here.
From a loose Easy to an eight-move Hard
Switch Opponent to Computer and pick a level under Difficulty. Whichever you choose, the computer completes a five whenever it has one, and each level keeps its own scoreboard:
- Easy blocks your four most of the time, but not always, and otherwise picks among a handful of good-looking moves, now and then a loose one. It's the level for learning how lines grow.
- Medium always blocks a single four and looks two moves ahead: its own move and your best reply, over its ten most promising points. It chooses among moves that score almost equally well, so games vary.
- Hard searches deeper, up to eight moves ahead, adding a move at a time until it has used about 0.7 seconds, and stops early if it finds a forced win.
The computer scores every line of five points on the board, all 572 of them, and favors lines that hold only its own stones. It considers only points within two steps of stones already on the board, which keeps its search on the part of the board where the fight is. The center point, H8, lies on 20 of those lines, the most any point can, while a corner lies on just 3. That's why the computer always opens on H8 when you let it play Black.
Set You play to Black to take the first stone yourself, or to White to hand the opening to the computer.
Two players: fair starts and handicaps
With 2 players selected, you and a friend alternate Black and White stones on the same board, and a separate Black and White scoreboard keeps the record. Undo takes back one stone at a time here, rather than a pair.
Black's head start is real, so between equal players, swap colors every game. When one of you is much stronger, a simple handicap is to give the weaker player Black every time. The game lives on one screen, so you'll want to sit together; there's no way to invite someone to a board from elsewhere.
Threes, fours, and double threats
Gomoku is a race of threats, and a few terms make the tactics easier to talk about:
- An open three is three in a row with both ends empty. Left alone, it becomes an open four.
- An open four has both ends empty, so it can't be stopped: block one end and your opponent plays the other.
- A four with one end blocked still forces a reply, because it threatens five on the next move.
- A double threat, such as a four and a three at once, gives your opponent two things to stop. They can answer only one.
So block an open three as soon as it appears, and attack with tempo: each four you make forces your opponent to answer where you choose while you build the next threat. Start near the center, where stones can grow lines in every direction, and keep your stones close enough to share lines. If you've played 9x9 Tic Tac Toe, which also needs five in a row, you'll recognize many of the same ideas.
Teaching a child five in a row
Gomoku is easy to teach a child who already plays Tic Tac Toe: it's the same idea on a bigger board, with five to line up instead of three, and there are no captures or special moves to remember. Start them on Easy, which blocks most fours but leaves room to win, and move up to Medium once open threes stop catching them out.
On a tablet, the aim-then-place tap means a slip of the finger shows a see-through stone instead of placing a real one. In 2-player mode, giving the child Black every game is a simple handicap, since moving first is worth a lot.
Aiming a stone with a mouse, a double tap, or the arrow keys
With a mouse, a see-through stone follows your pointer and a click places it. On a touch screen, the first tap shows where your stone will go and a second tap on the same point places it, so a slip of the finger won't put a stone in the wrong place. The wooden board scales down to fit a phone and up to fill a monitor.
With a keyboard, Tab to the board, move the cursor with the arrow keys, and press Enter or Space. U takes a move back and N starts a fresh board. Points are named the way Go boards name them, columns A to P without the letter I and rows counted from the bottom, so the center is H8, and each move is announced for screen readers.
All of the computer's thinking happens in this browser tab, so once the board has appeared, a slow connection never slows Hard down, and the stones you place aren't sent to a server.
Five in a row, Gobang, and the history of Gomoku
The name Gomoku is Japanese: its full form, gomokunarabe, means roughly five pieces lined up. It's traditionally played with Go stones on a Go board. Older boards had 19 lines each way, and 15×15 is the usual size today. Gobang is an older English name, Korean players call it omok, and in China it's wuziqi, while many people simply say five in a row or connect five.
Gomoku players long suspected that Black can always win, and in 1993 Victor Allis and his colleagues proved it for freestyle Gomoku on a 15×15 board, using computer search methods called threat-space search and proof-number search. That's why tournament rules restrict Black or use special openings.
Like lines? Four in a Row adds gravity, so discs stack from the bottom, and Ultimate Tic Tac Toe plays nine small boards at once.
Saved positions and scoreboards
A half-played game survives closing the tab: the position is stored in this browser's local storage along with your stone color, your level, and a scoreboard for each opponent. That storage stays on this device and isn't copied to a server. Reset scores clears only the opponent you're facing, and the privacy policy names every item the site stores.