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

How-to

Draw boards and choose materials

Use native SVG geometry and palette overrides independently of game rules.

Draw a standalone SVG

import { classicTriangle } from "@johnmorrisdotca/tobiishi";
import { draw,boundsOf,pointOf } from "@johnmorrisdotca/tobiishi/draw";
const game=classicTriangle().game;
const svg=draw(game,{material:"wood",theme:{accent:"#2f6b4f"},title:"Triangle lesson"});
console.log(svg.startsWith("<svg"),boundsOf(game),pointOf(game,0));
true { width: 330, height: 298 } { x: 165, y: 45 }

Stone, wood and glass are native palettes. Partial theme fields replace their corresponding colours. Drawing derives its geometry from the native board lattice; a cell index must belong to this game. SVG text is suitable for server output and images without a DOM. A selected hole and a goal marker are presentation, while move legality stays in the engine.

Keep host controls separate

The browser mount can render only the board for a host with its own controls, or supply the native settings and interactions. Material/language updates preserve the game. The existing README look examples retain the complete palette fields and board-only recipe.

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