canForfeitfunction
Whether a recorded forfeit could have been written here: only where the
clock had no pass to write instead. The replay's half of forfeitOnRecord,
and the reason a forfeit where a pass was on offer is refused rather than
read — it is a record the claim could not have made.
Import it
import { canForfeit } from "@johnmorrisdotca/narabe";
Definition
function canForfeit(state: GameState): boolean
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
Returns
boolean
Whether a recorded forfeit could have been written here: only where the clock had no pass to write instead. The replay's half of forfeitOnRecord, and the reason a forfeit where a pass was on offer is refused rather than read — it is a record the claim could not have made.
Examples
import { canForfeit, createGame } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
console.log(canForfeit(state));trueWhat it prints (run when this page was built)