areaWinner関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The colour whose area plus komi wins the Go position.
インポート
import { areaWinner } from "@johnmorrisdotca/narabe/rules/go";
定義
function areaWinner(board: Cell[], size: number, komi: number): Stone
引数
| 名前 | 型 | 説明 |
|---|---|---|
board | Cell[] | The row-major board cells; null marks an empty point. |
size | number | The number of cells on each side of the board. |
komi | number | The score bonus credited to white. |
戻り値
Stone
Black when its area is greater than white area plus komi; otherwise white.
例
import { createGame, playMove } from "@johnmorrisdotca/narabe";
import { areaWinner } from "@johnmorrisdotca/narabe/rules/go";
const go = playMove(createGame({variant:"go",size:9}),{row:4,col:4});
console.log(areaWinner(go.board, go.settings.size, 6.5));black出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。