passTurnfunction
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 it
import { passTurn } from "@johnmorrisdotca/narabe";
Definition
function passTurn(state: GameState): GameState
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
Returns
GameState
The resulting position; a refused or inapplicable action leaves the input position unchanged.
Examples
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);2What it prints (run when this page was built)