Gomoku (Five in a Row)

Gomoku — also known around the world as Five in a Row, Gobang, Renju (in Japan), Wuziqi (in China), and Omok (in Korea) — is one of the purest strategy board games ever created. You can learn the rules in ten seconds, yet spend years mastering its traps, forks, and opening theory.

At its heart, the objective is simple: two players take turns placing black and white stones on the intersections of a 15×15 or 19×19 grid (traditionally a wooden Go board). Black plays first, and the first player to form an unbroken line of five stones — horizontally, vertically, or diagonally — wins the match.

Gomoku Five in a Row

Understanding Gomoku Rules & Variants

Although casual Gomoku has almost no restrictions, mathematicians proved in the 1990s (notably Victor Allis in 1994) that Black has a forced win with perfect play on an unrestricted 15×15 board. To balance this first-player advantage and keep competitive matches exciting, several official rulesets evolved:

  • Freeplay (Freestyle): Classic, unrestricted Gomoku. Players can place stones anywhere, and you can choose whether overlines (6 or more stones in a row) count as a win or if exact 5 is required.
  • Renju: The professional Japanese tournament standard. To offset going first, Black is prohibited from making Double Three (3-3), Double Four (4-4), and Overline (6+) moves — unless the move immediately forms an exact 5. White has no restrictions and wins with 5 or more.
  • Swap2: The official international Gomoku championship rule. Player 1 places 3 stones (2 Black, 1 White). Player 2 then chooses to play White, swap to Black, or place 2 more stones (1 White, 1 Black) and let Player 1 pick their color. Exact 5 wins.
  • Pro: Black's 1st move must be at the center (Tengen), White's 2nd move goes anywhere, and Black's 3rd move must be placed outside the central 5×5 square (at least 3 intersections away). Exact 5 wins.
  • Long Pro: Like Pro, except Black's 3rd move must be placed even farther out — outside the central 7×7 square (at least 4 intersections from the center). Exact 5 wins.

Download Gomoku

You can easily download Gomoku on Android simply by searching "Gomoku" or "Five in a Row" on the Google Play Store.

There are dozens of Gomoku games available with varying features — ranging from minimal offline boards to full tournament-rule editions. When picking one, look for:

  • Accurate touch controls (essential on mobile screens where grid lines are close together).
  • Multiple rule presets (Freeplay, Renju, Swap2, Pro, Long Pro) so you never outgrow the game.
  • Smart, scalable AI difficulty that challenges beginners without feeling unfair, and pushes veterans with real tactical depth.
  • Clean local Pass & Play features so two people can comfortably share one phone.

Gomoku and CPU Algorithms

Before deep neural networks entered the scene, classic CPU algorithms made Gomoku computers remarkably strong — and surprisingly fast — using structured search and tactical heuristics:

  1. Pattern-Based Heuristic Evaluation: Instead of evaluating random board squares, a Gomoku engine scans 4 axes (horizontal, vertical, and both diagonals) around candidate intersections to score threats such as Live Fours (_●●●●_, an unstoppable win), Dead/Broken Fours (●●●_●), Live Threes (_●●●_), and Double-Threat Forks (like a 4-3 or 3-3 fork).
  2. Minimax with Alpha-Beta Pruning: The CPU simulates future moves several plies ahead, assuming both sides play optimally, while Alpha-Beta pruning discards branches that cannot possibly beat an already-found move. Pairing this with Iterative Deepening lets an engine think deeper within a strict millisecond budget.
  3. Threat-Space Search & VCF (Victory by Continuous Four): Because forcing moves (fours) leave the opponent with only one or two legal blocks, algorithms like VCF and VCT (Victory by Continuous Threat) can look 8 to 15+ moves deep in a fraction of a second — instantly spotting forced checkmate sequences that standard shallow Minimax would miss.
  4. Proof-Number Search (PNS): Used in endgame and opening solvers (including Victor Allis's proof that Freestyle Gomoku is a first-player win) by focusing search effort on the narrowest, easiest-to-resolve tactical branches.

Gomoku and AI

Because Gomoku sits right in the sweet spot between Tic-Tac-Toe (too trivial) and Go (astronomically huge), it has long been a favorite benchmark for Artificial Intelligence research and testing:

  • Gomocup & Algorithmic Benchmarks: Every year since 2000, the international Gomocup tournament pits AI engines from developers and researchers worldwide against each other across Freestyle, Standard, and Renju rules.
  • Monte Carlo Tree Search (MCTS): Researchers use Gomoku to test how MCTS balances exploration and exploitation in tactical games where a single missed block loses immediately.
  • Deep Reinforcement Learning (AlphaZero-Style AI): Modern AI systems combine convolutional or transformer policy/value networks with MCTS or threat search. Starting from zero human knowledge and playing millions of self-play games, neural networks learn subtle positional control, diagonal influence, and Renju trap avoidance — making Gomoku an ideal proving ground for testing new AI architectures quickly.

Developing Gomoku

If you want to build your own Gomoku mobile game, a clean workflow from design to gameplay polish makes all the difference:

1. Designing the Visuals

Start by designing the screen flow, wooden board, 3D stones, HUD cards, and dialogs in a design tool like Figma or Penpot. Designing the walnut frame, recessed Kaya wood playfield, star points (Hoshi), and clean high-contrast tokens up front ensures your game looks cohesive on every screen size.

2. Choosing an Engine & Implementing

Next, move into a cross-platform game framework like Godot or LibGDX. Both give you full control over 2D rendering, custom shaders/animations, audio playback, and native Android/desktop deployment.

3. Key UX & Engineering Details to Nail

  • Precision Touch Detection: A 15×15 or 19×19 board has tight intersections on a phone screen. Make sure your coordinate math accounts for exact outer frame margins and inner board padding — and consider a two-step placement flow (a preview reticle on tap + second tap or a Place Stone confirmation button) so players never lose a match to a misclick.
  • Local Pass-and-Play Clarity: When two friends share one device, it is surprisingly easy to lose track of whose turn it is. Use clear active-player turn indicators, highlight the last move placed, and include an Undo option for friendly games.
  • Move Numbering: Adding an optional toggle to display move numbers (1, 2, 3...) directly on top of the stones (white numbers on black stones, black numbers on white stones) lets players analyze openings and review tactical sequences in real time.
  • Multi-Level CPU Difficulty: Run AI search asynchronously on a background thread so animations stay smooth, and offer distinct tiers — from forgiving Easy/Medium opponents for casual play to Hard/Master engines powered by VCF and Alpha-Beta search.
  • Flexible Rules Engine: Support Freeplay (with an editable Overlines >5 toggle), Renju (with live forbidden ✕ indicators so beginners can learn 3-3/4-4 rules visually), Swap2, Pro, and Long Pro.

Play Our Gomoku — Five in a Row

Looking for a clean, thoughtfully crafted Gomoku experience that puts strategy and fun first? Try our version on Google Play!

👉 Download Gomoku - Five in a Row on Google Play

Features

  • 5 Official Rulesets: Play Freeplay (with customizable Overlines >5), Renju (with live forbidden-move ✕ hints), Swap2, Pro, and Long Pro.
  • 15×15 & 19×19 Wooden Boards: Authentic Kaya wood aesthetics with Hoshi star points, edge coordinates, smooth stone-drop ripples, and glowing victory lines.
  • 4 Smart AI Difficulty Levels: Challenge Easy, Medium, Hard, or Master CPU opponents powered by pattern heuristics, VCF threat search, and Alpha-Beta Minimax.
  • Local 2-Player Pass & Play: Clear active-turn HUD, dedicated confirmation buttons, and Undo support.
  • Move Numbers Toggle: Show or hide move counts (1, 2, 3...) directly on each stone with crisp high-contrast digits.
  • Interactive Tutorial & Multi-Language Support: Learn the ropes step by step, with full localization in English, Japanese, Korean, and Simplified Chinese.

0 Comments