Gomoku (Five in a Row)
Five in a row on a 15x15 board. An open four cannot be blocked, which is the fact the whole game is organised around.
An open four cannot be blocked
That single fact organises the whole game. Four in a row with both ends free wins next move whatever the opponent does — plug one end and the other still completes five. A closed four, with one end already occupied, has only one completion and so must be answered but can be. An open three is dangerous because it becomes an open four, which is why strong players spend the middlegame preventing threes rather than blocking fours.
Free-style gomoku — where any five or more in a row wins and there are no restrictions on black — was solved by Victor Allis in 1993 and is a first-player win. This game plays free-style, so black really does have the advantage, and tournament rulesets exist precisely to take it away. The engine here scores threat shapes rather than searching deeply, because in gomoku a shallow search that understands open threes beats a deep one that does not.
How to use
- Click an intersection to place a stone.
- Five in a row wins — horizontally, vertically or diagonally.
- Watch for open threes; they become open fours, which cannot be stopped.
- Black moves first and, in free-style, has a proven advantage.
Frequently asked questions
How do you win at gomoku?
By getting five of your stones in an unbroken line, in any direction. In the free-style rules used here six or more also counts, which is not true of every ruleset. The board is fifteen by fifteen and stones never move once placed, so the whole game is about creating threats faster than your opponent can answer them.
What is an open four and why does it matter?
Four in a row with both ends empty. It is unanswerable: plug one end and the other still completes five, so whoever makes one has already won. That single fact organises the entire game — strong players spend the middlegame preventing the open threes that become open fours, rather than blocking fours after they appear.
What is the difference between an open and a closed four?
A closed four has one end already occupied, so there is only one square that completes it and the opponent can take that square. An open four has two, and no single move covers both. That is why a closed four is merely forcing while an open four is winning, and why the distinction is the first thing to learn.
Does the first player have an advantage?
Yes, and it is proven rather than suspected. Victor Allis solved free-style gomoku in 1993 and showed it is a first-player win with perfect play. This game plays free-style, so the advantage is real — tournament rulesets such as Renju exist specifically to handicap black and restore balance.
What are Renju rules?
A tournament ruleset that forbids black from making certain shapes — double threes, double fours and overlines of six or more — while leaving white unrestricted. The point is to take away black proven winning advantage, and it works well enough that Renju is genuinely balanced where free-style is not.
What is a good opening?
The centre, and then stones that build several potential lines at once rather than a single obvious one. A stone that lies on multiple future rows is worth more than one that extends a single row, because gomoku is won by making two threats at the same time — one threat is always answerable.
How do you defend against a strong attack?
By counter-attacking rather than only blocking, where you can. Pure defence loses because each block answers one threat while the attacker builds the next. Where you must block, block the end that also develops a line of your own, and look for a move that answers their threat and creates one at the same time.
What is a double three?
A single stone that creates two open threes at once. Each open three would become an open four next move, and the opponent can only stop one — so a double three usually wins. Recognising them a move early, from both sides, is most of what separates a strong club player from a beginner.
How strong is the computer opponent?
It evaluates threat shapes rather than searching deeply, which is the right trade for gomoku — a shallow engine that understands open threes beats a deep one that does not. It will always take an immediate win and always block a closed four, so it punishes careless play, but it does not plan long combinations.
Is gomoku the same as Connect Four?
No. Connect Four is played on a seven by six grid where pieces fall to the bottom of a column, so you cannot choose the row. Gomoku lets you place anywhere on a much larger board and needs five rather than four, which makes it far more open and far more about shape than about column counting.
What are the other names for this game?
Gobang and Five in a Row are the usual English names, Gomoku is the Japanese one, and Omok is the Korean. Renju is the specific tournament ruleset rather than the game itself. They all refer to the same basic idea, but the rules about overlines and forbidden moves differ between them.
Does the game save my progress?
No. Everything runs in your browser, nothing is stored or uploaded, and closing the tab loses the current position. Undo steps back through your own moves within a session.
🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.