Gomoku – Five in a Row

Gomoku - Five in a Row

Black 0White 0
Black to move

How to play: Black moves first. Click any empty intersection to place your stone. The first player to line up 5 stones horizontally, vertically, or diagonally wins. Switch modes any time to play a friend or face the AI.

About Gomoku

Gomoku — also called Five in a Row, Omok, or Renju — is a classic two-player abstract strategy game played on a 15×15 grid. Black moves first, players alternate placing stones on empty intersections, and the first to line up exactly five stones horizontally, vertically, or diagonally wins. The rules fit on a napkin; the depth fits a lifetime.

Our online version lets you play head-to-head with a friend on the same screen, or face our AI at three difficulty levels: Easy, Medium, and Hard. The Hard AI looks one ply ahead, evaluates open threes, fours, and capture geometry, and will absolutely punish loose play. Every move is highlighted with a red ring so you can see what just happened, and your win count is tracked across games.

How to Play Gomoku

  1. Choose your mode — vs AI (then pick Easy / Medium / Hard) or vs Player 2 for couch multiplayer.
  2. Black moves first. Click any empty intersection on the board to place your stone.
  3. Alternate turns. White (or the AI) places next, then Black, and so on.
  4. Make a row of 5 — horizontal, vertical, or diagonal — to win the game.
  5. Block your opponent when they have an open three or open four; if you don’t, they’ll win on the next move.
  6. Hit Reset any time to start a new round. Win count carries across rounds.

Strategy Tips

  • Open threes are priority threats. A three-in-a-row with both ends open creates a forced four next turn. Block at least one end immediately or build your own faster threat.
  • Double threats win games. If you can place a stone that creates two open threes (or a three plus a four) at once, your opponent can only block one of them.
  • Center is power. The middle of the board has more directions to grow into. Black’s first move is traditionally the center; mirror that pattern when you can.
  • Read 2 moves ahead. Before placing, ask: “If I play here, what is my opponent’s best reply, and can I follow up with a double threat?”
  • Don’t chase. Reactively blocking every threat loses tempo. When you can answer a threat AND create one of your own with the same stone, do it.
  • Diagonals are sneaky. Beginners watch rows and columns and miss diagonal lines. Always scan all four directions before each move.

A Brief History of Gomoku

Gomoku originated in Japan during the Heian period (around 1000 AD) and was refined in China and Korea over the following centuries. The name comes from the Japanese words go (five) and moku (pieces). It was traditionally played on a 19×19 Go board with Go stones, but the modern competitive version uses a 15×15 grid. A tournament-balanced variant called Renju adds rules that restrict Black’s opening moves to compensate for the first-move advantage; our version is the classic free-style ruleset, which is friendlier for casual play.

Frequently Asked Questions

Is Gomoku a solved game?

Yes — under free-style rules with no restrictions, Black (the first player) has a forced win with perfect play, proven by L. Victor Allis in 1993. That’s why competitive Renju tournaments use opening restrictions for Black. In casual play between humans (or against an AI that doesn’t search to depth 30+), the game stays interesting and the first-move advantage is rarely decisive.

What’s the difference between Gomoku and Connect 4?

Both games are about lining up pieces in a row. Connect 4 uses gravity (pieces drop to the bottom of a column) on a 7×6 grid and you need 4 in a row. Gomoku is played on a 15×15 grid with no gravity — you can place stones anywhere — and you need 5 in a row. Gomoku has a much larger search space and more strategic depth.

Does Black always win?

In theory, with perfect play, yes — but only against another perfect player. Against the AI or a human friend, Black has a small edge but plenty of games are won by White. Try playing as White against the Hard AI to test your defense.

How does the AI work?

Each empty intersection near existing stones is scored for both attack potential (how many threats you’d create) and defense need (what threats you’d block). Easy adds a lot of randomness so it makes mistakes; Medium picks from the top three candidates; Hard does a one-move lookahead, simulates your best reply for each candidate move, and picks the move with the best net score.

Can I play on a phone?

Yes. The board is responsive and the UI scales down for small screens. Tap an empty intersection to place a stone — same as clicking with a mouse.

What if I make a mistake — can I undo?

Not in this version. Gomoku at master level is played without takebacks, so we follow the same rule. You can hit Reset any time to start a fresh game; your overall win count is preserved across rounds.

Are exactly five required, or do six in a row also win?

In our free-style version, six or more in a row also count as a win. Tournament Renju rules require exactly five for Black (overlines are forbidden), but for casual play we keep it simple: five-or-more wins.

How long does a typical game last?

About 5–15 minutes between two attentive players. Quick games against Easy can finish in under 3 minutes; serious matches against Hard regularly stretch past 20 minutes as both sides build threats and counter-threats.


Skip to Accessibility Panel