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 · Native peg-solitaire player

mountfunction

Mount one independent player. The host owns persistence through onChange and setGame.

Import it

import { mount } from "@johnmorrisdotca/tobiishi/play";

Definition

function mount(host: HTMLElement, options?: MountOptions): Player

Parameters

NameTypeDescription
hostHTMLElement

The element that owns this player and its controls.

options (optional)MountOptions

Initial puzzle, presentation and persistence callback.

Returns

Player

A player with game access, replacement, presentation updates and cleanup.

Examples

import { mount } from "@johnmorrisdotca/tobiishi/play";
if (typeof document !== "undefined") {
  const player = mount(document.createElement("div"));
  player.set({ material: "wood", language: "ja" });
  player.destroy();
}
console.log(typeof mount);
function

What it prints (run when this page was built)

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