passTurn関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Takes a turn without a stone. Two passes end a piece game as a draw; in Go they end it by area count instead, since passing there is a real choice, not a sign nobody can move. A replay passes at the same point either way.
インポート
import { passTurn } from "@johnmorrisdotca/narabe";
定義
function passTurn(state: GameState): GameState
引数
| 名前 | 型 | 説明 |
|---|---|---|
state | GameState | The current immutable game position. |
戻り値
GameState
The resulting position; a refused or inapplicable action leaves the input position unchanged.
例
import { createGame, passTurn, playMove } from "@johnmorrisdotca/narabe";
const go = playMove(createGame({variant:"go",size:9}),{row:4,col:4});
console.log(passTurn(go).moves.length);2出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。