gobang
javascript gobang AI,JS五子棋AI,源码+教程,基于Alpha-Beta剪枝算法(不是神经网络)
What is gobang?
javascript gobang AI,JS五子棋AI,源码+教程,基于Alpha-Beta剪枝算法(不是神经网络)
Overview of gobang
What it is
gobang is a JavaScript implementation of a Gomoku (Five-in-a-Row) AI. It is based on the minimax search algorithm with Alpha-Beta pruning, not neural networks. The project provides source code and tutorials for building a Gomoku AI. The AI runs entirely in the browser after the page is loaded, requiring no network connection for gameplay.
Key features
- AI based on minimax search with Alpha-Beta pruning, iterative deepening, Zobrist caching, and other optimizations
- Multiple difficulty levels that adjust search depth (deeper = stronger but slower)
- Game import/export as JSON (serializes move history and settings, supports clipboard and file download)
- Tactical puzzle library with 8 rotation/mirror symmetries for testing AI strength
- Built-in AI evaluation tool for comparing engine versions via head-to-head matches
- VCT (Victory by Continuous Threat) search with improved pruning of isolated threats
Use cases
- Learning and experimenting with game AI algorithms (minimax, Alpha-Beta pruning, evaluation functions)
- Playing Gomoku against an AI opponent in a browser
- Testing and comparing AI strength through automated evaluation and tactical puzzles
- Studying the source code and accompanying blog tutorial series for educational purposes
Getting started
Clone the repository and install dependencies:
npm install
Start the local development server:
npm start
Other available commands:
npm test– run unit testsnpm run build– build for production (outputsdist/directory)npm run ai:evaluate– run AI strength evaluation (see README for options)npm run ai:tactics– run tactical puzzle tests
License and pricing
The project is open source. The specific license is not stated in the repository metadata or README.
Based on the project's public README and repository metadata.