⚫ Try it now → https://naklitechie.github.io/KoLocal/
Play Go (Baduk/Weiqi) against an AI opponent — entirely in your browser. No install, no account, no ads, nothing uploaded anywhere.
- Full Go rules on 9×9, 13×13, or 19×19 boards
- Three difficulty levels (Easy / Medium / Hard) backed by Monte Carlo Tree Search
- Liberties, capture, ko, suicide, and Japanese territory scoring — all implemented correctly
- Stone hover preview shows where you're about to place
- Last-move marker so you always know what the AI just did
- Correspondence mode — every move updates the URL. Copy the link, send it to a friend, play async. No server, no login — the URL is the save file.
- SGF export for game records
- Tap-to-move on mobile (no drag required)
- You are Black and move first. Tap an intersection to place a stone.
- Surround opponent stones to capture them — a group is captured when all its adjacent empty points (liberties) are filled.
- You can't play a move that leaves your own stone with zero liberties, unless it captures.
- Ko rule: you can't immediately recapture a single stone that just captured yours.
- Both players pass consecutively to end the game. Territory is then counted.
- Score = your territory + your captures. White gets 7.5 points komi (compensation for going second).
| Concern | Solution |
|---|---|
| Game logic | Pure vanilla JS — liberties, capture, ko, suicide, scoring |
| AI engine | Monte Carlo Tree Search with fast numeric playout board |
| Board rendering | Canvas with radial-gradient stones, DPI awareness |
| Correspondence | URL hash — compressed board state in fragment |
| Dependencies | Zero |
| Build step | None — open index.html, it works |
MCTS needs thousands of random game simulations (playouts) per move. Running those through the full rules engine — with DFS group searches, string-keyed Sets, and board hashing — was far too slow.
The fix: a separate FastBoard playout engine that uses Int8Array for the board, pre-allocated scratch buffers (no GC pressure), inline capture/suicide checks, and simple ko tracking via a single forbidden-point index. It shuffles empty intersections and tries random moves directly instead of pre-computing all legal moves.
Result: ~500ms for 2000 playouts on 9×9 — the full rules engine is only used for the real game and tree expansion, never during simulation.
Coloured with japan-02 · 生成り KINARI — Edo merchant ledger, washi paper. Warm cream body, kaya-wood goban, classic black-and-white stones, Edo-navy action accent. The colour of a 19th-century Japanese paper-and-wood game room.
Palette pulled from Rangrez, the global colour-palette library that backs all NakliTechie projects.
Browser-native tools — no server, no API keys, no data leaving the device.
| Tool | What it does |
|---|---|
| BabelLocal | Offline translation — 200 languages, NLLB model |
| StripLocal | EXIF metadata stripper — nothing leaves the browser |
| GambitLocal | Chess vs Stockfish — correspondence mode via URL |
| VoiceVault | Audio transcription — Whisper, offline-first |
| KingMe | English draughts — custom minimax AI, zero deps |
| KoLocal | Go (Baduk) — MCTS AI, zero deps |
| SnipLocal | Background remover — RMBG-1.4, passport mode |
| PredictionMarket | Prediction market simulator — Parimutuel & LMSR |
| LocalMind | Private AI chatbot — Gemma multimodal via WebGPU |
Built by Chirag Patnaik