AI ENGINEERING

Gomoku AI

Gomoku AI is a complete implementation of the Gomoku board game (Pente ruleset) featuring a competitive artificial intelligence capable of playing against human opponents.

YEAR

2026

ROLE

Designed • Developed • Shipped

STACK

C++SFMLMinimaxNegamaxAlpha-Beta PruningTransposition Table

01/PROBLEM → SOLUTION

02/SYSTEM ARCHITECTURE

How the system fits together

  1. Player
  2. Input Handler
  3. Game Engine
  4. AI Core
  5. Move Generator
  6. Evaluator
PlayerHUMANInput HandlerSFML EVENTSGame WindowUI NAVIGATIONGame SessionMOVE INTENTGame EngineSTATE MUTATORGame RulesSTATELESS VALIDATIONBoardGRID MEMORYZobrist Hashing64-BIT STATE FINGERPRINTAI CoreNEGAMAX CONTROLLERBoard CloneSIMULATION ENVIRONMENTTransposition TableO(1) HASH CACHEMove GeneratorCANDIDATE SORTINGEvaluatorHEURISTIC SCORINGRendererDRAW COMMANDS

Drag to pan or Hover to trace or Click to inspect

03/KEY ENGINEERING DECISIONS

Candidate Generation

Search restricted to moves near existing stones cuts the branching factor while preserving move quality.

Alpha-Beta Pruning

Prunes provably-losing subtrees so effective depth rises without extra compute.

Transposition Cache

A 64-bit Zobrist fingerprint keys an O(1) cache of evaluated positions, avoiding redundant work.

04/IMPACT & TAKEAWAYS

Time-Boxed Search. Returns the strongest move found within the execution-time limit.

Pente Ruleset. Handles stone captures, capture-win, breakable five, and capture prevention in generation and evaluation.

Search Depth. Effective depth increased by pruning and caching.