This project is a browser-based implementation of the board game Go (Weiqi/Baduk) written in TypeScript using HTML5 Canvas for rendering. The application includes basic Go gameplay, a simple AI opponent, and interactive features to support various board sizes and game modes.
- Playable Go board with 9x9, 13x13, or 19x19 sizes
- Manual play and AI opponent (Minimax-based)
- AI vs. AI simulation mode
- Capture detection including sound effects when stones are removed
- Ko rule and suicide prevention implemented
- Score counting based on territory and captured stones
- Responsive and dark mode–friendly user interface
- Visually enhanced board and stones with lighting effects
- TypeScript
- HTML5 Canvas
- JavaScript Modules (ES6)
- CSS (inline styling in HTML)
- Clone or download this repository.
- Place all files in the same directory (including audio files).
- Open
index.html
in any modern browser (Chrome, Firefox, Edge). - Select a board size and start a game using the buttons.
- Sounds: You can replace
click.wav
andcapture.wav
with your own sound files. - Styling: The dark mode and layout can be adjusted in the
<style>
section ofindex.html
. - AI Depth: The difficulty of the AI can be changed by modifying the Minimax depth in
Board.ts
.
- This is a simplified implementation and does not handle full Japanese or Chinese scoring rules.
- The AI is basic and may not always play strong moves.
- No support for pass or game-end negotiation (yet).
This project is provided for educational and personal use. Feel free to adapt or extend it as needed.