A Gomoku AI With Minimax, Alpha-Beta Pruning, and Pattern-Based Evaluation
Dev.to AI
•
AI Research
A Gomoku AI With Minimax, Alpha-Beta Pruning, and Pattern-Based Evaluation The hard AI does a 4-ply minimax search with alpha-beta pruning. A 15×15 board has 225 cells, so naive minimax at depth 4 would visit 225^4 ≈ 2.5B positions. Pruning + restricting moves to cells within radius 2 of existing stones cuts this to a few thousand. Combined with a pattern-based evaluator that scores open-three, closed-four, etc., the result plays competent opening and blocks immediate threats. Gomoku (five-in-a-row) is simpler than chess but deep enough to need actual search.