turnPassedByfunction
The colour whose turn passed because it had no move, as the latest turn left the board — or null when nobody's did.
Two ways a turn passes, and the record says both: a forced pass on the record, and the flipping games' pass with no row at all, where the colour that just moved is to move again. A pass somebody chose — Go's — is not one.
Import it
import { turnPassedBy } from "@johnmorrisdotca/narabe";
Definition
function turnPassedBy(state: GameState): Stone | null
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
Returns
Stone | null
The colour whose forced pass was recorded, or null when the latest move was not such a pass.
Examples
import { createGame, turnPassedBy } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
console.log(turnPassedBy(state));nullWhat it prints (run when this page was built)