pieceMovesfunction
Where a piece of the colour to move may step from from; empty if it may not move.
Import it
import { pieceMoves } from "@johnmorrisdotca/narabe";
Definition
function pieceMoves(state: GameState, from: Point): Point[]
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
from | Point | The source point of the group or moving piece. |
Returns
Point[]
Where a piece of the colour to move may step from from; empty if it may not move.
Examples
import { createGame, pieceMoves } from "@johnmorrisdotca/narabe";
const checkers = createGame({variant:"checkers"});
console.log(pieceMoves(checkers,{row:5,col:0}));[]What it prints (run when this page was built)