isOnBoardfunction
Whether both coordinates are within the square board.
Import it
import { isOnBoard } from "@johnmorrisdotca/narabe";
Definition
function isOnBoard(size: number, point: Point): boolean
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The number of cells on each side of the board. |
point | Point | A zero-based row and column on the board. |
Returns
boolean
Whether both coordinates are within the square board.
Examples
import { isOnBoard } from "@johnmorrisdotca/narabe";
const point = {row:7,col:7};
console.log(isOnBoard(15, point));trueWhat it prints (run when this page was built)