How to Play Gomoku
Gomoku, also known as Five in a Row, is played on a 15x15 grid. Players take turns placing stones on the intersections - black moves first. The first player to line up exactly five or more stones in a row horizontally, vertically, or diagonally wins the game. Stones never move or get captured once placed, so every stone is a permanent part of the battlefield.
On PlayVersusAI you play black against a white-stoned AI, or face a friend in real-time multiplayer. The AI recognizes open threes, broken fours, and double threats - on the higher difficulties it will punish a single careless move.
Strategy Tips
- Open threes force a response - three in a row with both ends open becomes an unstoppable four if ignored. Build them, and block your opponent's.
- Win with double threats - a single threat can always be blocked. Aim to create two threats with one stone (a "3x3" or "4x3" fork) so your opponent can only stop one.
- Play close to the action - stones far from the fight rarely matter. Most strong moves are within two intersections of existing stones.
- The center is king - the middle of the board touches the most possible lines. Opening in or near the center gives you the most future options.
- Defense is offense - the best blocking moves also extend your own lines. When you must defend, look for the block that builds toward your own five.
Read the full Gomoku guide →
Playing Gomoku on PlayVersusAI
Gomoku, or Five in a Row, played on a 15x15 grid. Players alternate placing stones on empty intersections and the first to line up five in a row — horizontally, vertically or diagonally — wins. Nothing is ever captured and nothing ever moves, which makes the rules learnable in about ten seconds and the strategy considerably harder.
The engine scores positions by recognising threat patterns rather than counting stones: an open three (three in a row with both ends free) forces a response, an open four is already winning, and a move creating two open threes at once is usually decisive. It searches around existing stones rather than the whole board, which is what keeps a 225-intersection grid tractable.
What's on This Page
- Four difficulty levels — switch between Easy, Medium, Hard and AI Training at any time, including mid-game.
- Online multiplayer — play a friend in real time using a private room code, or take on a stranger from the public lobby.
- Tracked results — wins count toward your profile statistics and the site leaderboard.
- No account required — the full game is playable as a guest, on desktop, tablet or phone.
Easy blocks your immediate fours but misses open threes. Medium answers threats correctly. Hard builds its own double threats while defending. AI Training looks for forcing sequences several moves deep, and once it has a double-three you are generally lost — the game is won or thrown away in the moves before that point.
Mistakes That Lose Games
- Only blocking the end of a line. A three with both ends open needs to be answered at the right end, or better, answered with a bigger threat of your own.
- Missing the double threat. Watch for any move that would give your opponent two open threes at once. That single square is usually the only move that matters on the board.
- Playing away from the action. Stones placed far from the fight do almost nothing in Gomoku. There is no territory to claim, only lines to build.
- Defending passively for too long. If you never create a threat, your opponent gets to choose the pace and eventually builds something you cannot answer.
Gomoku Questions
Is there a swap rule or an opening restriction?
No. This is freestyle Gomoku with no forbidden moves and no swap. Tournament Renju rules restrict the first player with extra prohibitions to offset the first-move advantage, but they add considerable complexity and are not used here.
Does exactly five count, or does six also win?
A line of five wins. A longer line contains a five, so it also wins — this implementation does not use the "overline does not count" restriction from Renju.
Why does the AI sometimes ignore my three in a row?
Because it has calculated that its own threat comes first. If it can force a win before you complete your line, blocking would just be slow. When it ignores you, check whether you are actually the one under attack.
For the complete rules, the deeper strategy and the history of the game, read the full Gomoku guide, or browse guides for all 20 games.