canPassfunction
Whether passing is on offer: forced in a piece game with nothing to lay, free at any point in Go.
This, and not mustPass, is the question anything accepting a pass asks. A
live game once asked only whether the pass was forced, which refused every
chosen pass in Go — a person's click and a computer's choice alike — so a Go
game on the server could never end by two passes, and a programs' game sat
stuck with the engine offering a pass the server would not take.
Import it
import { canPass } from "@johnmorrisdotca/narabe";
Definition
function canPass(state: GameState): boolean
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
Returns
boolean
Whether passing is on offer: forced in a piece game with nothing to lay, free at any point in Go. This, and not mustPass, is the question anything accepting a pass asks. A live game once asked only whether the pass was forced, which refused every chosen pass in Go — a person's click and a computer's choice alike — so a Go game on the server could never end by two passes, and a programs' game sat stuck with the engine offering a pass the server would not take.
Examples
import { canPass, createGame } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
console.log(canPass(state));falseWhat it prints (run when this page was built)