本文へ移動

Narabe並べ

48種類の盤上ゲームを、新しい局面を返す手の操作、合法手の一覧、再生できる棋譜で扱えます。

「並べ」は五目並べの「並べ」。石を並べることを表す言葉です。 名前について(英語)

目次

リファレンス

囲碁のルール

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.

ソースを見るGitHub で編集@johnmorrisdotca/narabe 1.3.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。