forbiddenReasonfunction
Why the colour to move may not play point, when a forbidden shape is why.
Import it
import { forbiddenReason } from "@johnmorrisdotca/narabe";
Definition
function forbiddenReason(state: GameState, point: Point): ForbiddenPattern | null
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
point | Point | A zero-based row and column on the board. |
Returns
ForbiddenPattern | null
The forbidden pattern, or null when this point has no forbidden shape.
Examples
import { createGame, forbiddenReason } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
const point = {row:7,col:7};
console.log(forbiddenReason(state, point));nullWhat it prints (run when this page was built)