Reference · Boards, rules and challenges
rectangleBoardfunction
Creates a square-lattice rectangle, including supported wide and tall boards.
Import it
import { rectangleBoard } from "@johnmorrisdotca/tobiishi";
Definition
function rectangleBoard(width: number, height: number): Board
Parameters
| Name | Type | Description |
|---|---|---|
width | number | The validated rectangle width in holes. |
height | number | The validated rectangle height in holes. |
Returns
Readonly<{ name: string; lattice: "square" | "triangle"; cells: readonly Cell[]; jumps: readonly Jump[]; }>
Creates a square-lattice rectangle, including supported wide and tall boards.
Examples
import { rectangleBoard } from "@johnmorrisdotca/tobiishi";
console.log(rectangleBoard(3,3).cells.length);9What it prints (run when this page was built)