⚫ Gomoku-zari

Win by lining up 5 in a row, horizontally, or diagonally! Challenge the AI to improve your Gomoku-zukuri strategy. 15 x 15 large board.

🌐 Online Battle
You (Black) CPU (White)
Your turn.

way of playing (a game)

  • Click on the board to place the black stone (you are first)
  • The winner is the first person to line up five in a row vertically, horizontally, or diagonally.
  • The CPU runs with an evaluation AI that takes offense and defense into account.
  • You can reset the game at any time by pressing the "New Game" button.

What is Gomoku?

Gomoku is a centuries-old abstract strategy game where two players alternate placing pieces on a grid, aiming to achieve five in a row—vertically, horizontally, or diagonally—before their opponent does. This web version features an intelligent AI opponent with lookahead capabilities that challenge even experienced players. The game combines the simplicity of tic-tac-toe with the strategic depth of chess, making it perfect for sharpening tactical thinking and pattern recognition skills.

How to Use

You play as one color; the AI plays the other. Click any empty square on the board to place your piece. The game displays all valid moves, and invalid moves are rejected. After your move, the AI calculates its response and places its piece automatically. The game continues until one player achieves five consecutive pieces or the board fills without a winner. The AI evaluates multiple moves ahead, considering both offensive opportunities and defensive blocks. Starting in the center typically offers stronger strategic positioning than edge squares. Pay attention to the AI's placement patterns—it prioritizes creating two-way winning threats that force you into impossible defensive positions. Each game teaches the AI's preferred strategies, helping you anticipate and counter subsequent matches.

Use Cases

Gomoku serves multiple purposes beyond casual entertainment: • Strategic Skill Development: Players developing chess or strategy game abilities use Gomoku as a faster-paced alternative that teaches lookahead thinking and threat evaluation in 5-10 minute sessions
AI Learning Study: Developers and students examining game AI analyze this implementation as a tractable example of minimax algorithms, heuristic evaluation, and pruning techniques
Cognitive Exercise: Brain training enthusiasts and students learning game theory use Gomoku to practice tactical calculation, pattern recognition, and long-term planning under competitive pressure
Mobile Gaming: The straightforward rules and AI opponent make Gomoku ideal mobile entertainment—quick to learn, impossible to master, engaging for all skill levels

Tips & Insights

Gomoku strategy fundamentally differs from tic-tac-toe because the larger board creates multiple winning paths simultaneously. Successful play requires identifying two-way threats—positions where you threaten to win in two different directions, forcing the opponent to block one while you complete the other. The AI uses evaluation functions that weight pieces creating multiple threats more heavily than isolated pieces. Playing near the center typically offers more winning possibilities than edge placement. The AI's difficulty often scales with look-ahead depth—deeper calculation reveals stronger strategies. Understanding forcing moves (threats that demand specific responses) accelerates your game improvement more than random play. Online Gomoku communities have developed opening systems similar to chess openings, though this tool's AI adapts rather than following traditional sequences.

Frequently Asked Questions

What are the rules?

The first player to line up five stones of the same color vertically, horizontally, or diagonally wins.

How strong is the CPU?

It uses an evaluation function that takes into account offense and defense and has a basic strategy.

What are the first and second moves?

The player is always first (black stones).

Can the stone be revoked?

Once a stone is placed, it cannot be undone. Place them carefully and thoughtfully.

How is Gomoku different from Tic-Tac-Toe and other similar games?

Gomoku uses a larger board (typically 15×15 instead of 3×3) and requires five in a row instead of three, making the game much more strategic and longer-lasting. Tic-Tac-Toe often ends in draws due to the small board, while Gomoku offers countless possible strategies and positions. The increased complexity makes Gomoku a genuine strategy game rather than a quick puzzle.

How long does a typical Gomoku game take to complete?

Casual games typically last 5-15 minutes, depending on player skill level and the AI's thinking time. Experienced players may finish faster as they recognize winning patterns immediately, while beginners may take longer exploring the board. Quick games are possible, but the best matches often involve careful strategic positioning.

Can I undo multiple moves, or just the very last move?

Most Gomoku implementations allow undoing only the most recent move to maintain game integrity. The revocation feature prevents regret-based gameplay and keeps matches fair. If you made a mistake several moves ago, restarting the game is usually the best option.

What are the most effective strategies to consistently beat the AI?

Control the center of the board early, create multiple threats that force the opponent to defend, and look for patterns where three or four stones in a row can be extended. Avoid leaving obvious gaps the AI can exploit, and always block the AI's winning moves immediately. Defensive play combined with gradual board control typically beats aggressive strategies.

Is there a way to play Gomoku against other human players online?

This particular Gomoku implementation is single-player against AI, but many online platforms like Chess.com and dedicated Gomoku sites offer multiplayer options. If you're looking for competitive human play, search for 'online Gomoku' or 'Renju' sites. The AI opponent here is perfect for practicing strategies before challenging human opponents.

What happens if both players fill the board without reaching five in a row?

The game is declared a draw, and both players score zero points from that match. In tournament Gomoku (Renju), there are specific rules about placement restrictions to prevent draws at high levels. In this casual version, a draw simply means the board ran out of space—an uncommon occurrence at higher skill levels.