isKingAtfunction
Whether the piece at at, if any, is a king.
Import it
import { isKingAt } from "@johnmorrisdotca/narabe";
Definition
function isKingAt(kings: readonly Point[], at: Point): boolean
Parameters
| Name | Type | Description |
|---|---|---|
kings | readonly Point[] | The points occupied by crowned pieces. |
at | Point | The point to examine. |
Returns
boolean
Whether the piece at at, if any, is a king.
Examples
import { createGame, isKingAt } from "@johnmorrisdotca/narabe";
const checkers = createGame({variant:"checkers"});
console.log(isKingAt(checkers.kings,{row:5,col:0}));falseWhat it prints (run when this page was built)