Skip to the content

Narabe並べ

Play forty-eight abstract board games through immutable moves, legal choices and replayable records.

Narabe means arranging in Japanese, as in gomoku-narabe: five in a row. About the name

Contents

Reference

Go rules

import { … } from "@johnmorrisdotca/narabe/rules/go";

5.8 kB minified and gzipped, with everything it imports (measured with esbuild)

Exports

NameKindWhat it is
applyGoMovefunctionA stone of stone played at point: the board it leaves, and what it captured — or null, meaning the move is suicide and illegal.
areaWinnerfunctionThe colour whose area plus komi wins the Go position.
goLegalfunctionWhether stone may play point: on the board, empty, not suicide, and not the one point the simple ko rule forbids retaking this move — exactly the point a single-stone capture just vacated, so the immediate recapture cannot instantly restore the position it broke.
groupAtfunctionThe connected group of stones sharing the colour at from, and the empty points touching any of them — its liberties.
KOMIconstantGo: stones never move once played, and nothing about a line ever decides anything.
playGoMovefunctionPlays a stone at point, already known legal: captures whatever it takes, sets a fresh ko point when that capture was exactly one stone (and clears it otherwise), and passes the turn — Go has no further move of its own to settle, unlike the twist games or a piece game's line.
scoreAreafunctionThe area score: every stone on the board, plus every empty region whose only neighbours are one colour.
walledInfunctionThe empty points stone has already walled in: every empty region whose border is that colour's stones and nothing else — the ground scoreArea counts as theirs.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/narabe 1.3.0.