Reference · Boards, rules and challenges
boardOffunction
A familiar lattice or a shaped outline. Shapes describe holes, never a different capture rule.
Import it
import { boardOf } from "@johnmorrisdotca/tobiishi";
Definition
function boardOf(shape?: Shape): Board
Parameters
| Name | Type | Description |
|---|---|---|
shape (optional) | Shape | One of the built-in SHAPES. |
Returns
Readonly<{ name: string; lattice: "square" | "triangle"; cells: readonly Cell[]; jumps: readonly Jump[]; }>
A familiar lattice or a shaped outline. Shapes describe holes, never a different capture rule.
Examples
import { boardOf } from "@johnmorrisdotca/tobiishi";
console.log(boardOf("triangle").cells.length);15What it prints (run when this page was built)