リファレンス
囲碁のルール
import { … } from "@johnmorrisdotca/narabe/rules/go";
最小化と gzip 圧縮をしたサイズは 5.8 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
applyGoMove | 関数 | A stone of stone played at point: the board it leaves, and what it captured — or null, meaning the move is suicide and illegal. |
areaWinner | 関数 | The colour whose area plus komi wins the Go position. |
goLegal | 関数 | Whether 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. |
groupAt | 関数 | The connected group of stones sharing the colour at from, and the empty points touching any of them — its liberties. |
KOMI | 定数 | Go: stones never move once played, and nothing about a line ever decides anything. |
playGoMove | 関数 | Plays 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. |
scoreArea | 関数 | The area score: every stone on the board, plus every empty region whose only neighbours are one colour. |
walledIn | 関数 | The 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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。