mustPassfunction
Whether the colour to move has nothing it may play. Then the turn passes, on the record, rather than the game stopping where it stands.
Gated to piece games once, so a stone game reaching the same condition fell through it: a handicap forbids shapes to one colour, and the last point on a board can be a shape that colour may not make. The board then never fills, the draw never comes, and neither can move. Passing decides nothing.
Import it
import { mustPass } from "@johnmorrisdotca/narabe";
Definition
function mustPass(state: GameState): boolean
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
Returns
boolean
Whether the colour to move has nothing it may play. Then the turn passes, on the record, rather than the game stopping where it stands. Gated to piece games once, so a stone game reaching the same condition fell through it: a handicap forbids shapes to one colour, and the last point on a board can be a shape that colour may not make. The board then never fills, the draw never comes, and neither can move. Passing decides nothing.
Examples
import { createGame, mustPass } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
console.log(mustPass(state));falseWhat it prints (run when this page was built)