碁

GO

Baduk · Weiqi · 9 · 13 · 19

PLAY IN YOUR BROWSER A 19x19 opening on the kaya board

What it is

A go board you can actually play on: exact rules (captures, suicide, ko and positional superko, Chinese area or Japanese territory scoring, handicap, SGF), a Monte-Carlo tree search opponent with RAVE that thinks in a background worker, and a table that looks and sounds like the real thing — kaya grain, slate and shell stones with their own shadows, bowls, lids filling with prisoners, and the clack of a stone on wood. Plain HTML5 Canvas, Web Audio and vanilla JavaScript; no frameworks, no build.

Features

Exact rules

Zobrist-hashed positions for superko, simple ko, suicide, multi-group captures, two-pass ending, undo, handicap on the star points. 21 unit tests.

Monte-Carlo AI

UCT + RAVE with atari-aware playouts on a pseudo-liberty union-find board: ~32k playouts/s on 9×9. Three strengths, live win-rate, passes when ahead, resigns when lost.

Scoring phase

Dead stones suggested from playouts, click a group to flip it, score line updates live, accept or resume. Area or territory counting with komi.

Reading aids

Territory estimate overlay, move numbers, last-move ring, hover ghost stone, coordinates.

Table and sound

Photoreal board and stones with capture animations into the lids; synthesized clacks, clinks, pass and clock tones.

Clocks and records

Main time with byo-yomi periods and loss on time; SGF save and load.

Screenshots

New game dialog
New game: board, handicap, komi, rules, players, strength, clock.
9x9 against the AI
9×9 against the AI.
Capture animation
Captured stones on their way to the lid.
Territory estimate
Territory estimate overlay.
Move numbers
Move numbers.
Scoring
Scoring with a dead stone marked.
Result
The result.

Controls

ActionMouseKeyboard
Play a stoneClick an intersection—
Pass / Undo / ResignButtonsP / U
Estimate / Numbers / CoordinatesButtonsE / N / C
Mark dead stones (scoring)Click a group—
New game / MuteButtonsG / M

Run it yourself

Open index.html, or serve the folder (python -m http.server 8770 or start.cmd on Windows). The README covers the rules tests, self-play and the headless smoke test.