Skip to the content

Tobiishi飛び石

Jump pegs on nine native boards, generate seeded solvable challenges and build a peg-solitaire player for your page.

Tobiishi is the Japanese word 飛び石 for stepping stones. About the name

Contents

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

NameTypeDescription
widthnumber

The validated rectangle width in holes.

heightnumber

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);
9

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/tobiishi 0.3.1.