Reference · Native peg-solitaire player
MountOptionstype
Initial puzzle, display choices, optional settings host, and persistence callback.
Import it
import type { MountOptions } from "@johnmorrisdotca/tobiishi/play";
Definition
type MountOptions = {
game?: Game;
challenge?: Challenge;
shape?: Shape;
seed?: string;
challengeJumps?: number;
language?: Language;
material?: Material;
theme?: Partial<Theme>;
justBoard?: boolean;
settingsHost?: HTMLElement;
onChange?: (game: Game, code: string) => void;
};
Members
| Name | Type | Description |
|---|---|---|
game (optional) | Readonly<{ board: Board; start: readonly boolean[]; pegs: readonly boolean[]; target: number | null; history: readonly Jump[]; helped: boolean; }> | undefined | |
challenge (optional) | Readonly<{ game: Game; answer: readonly Jump[]; seed: string; }> | undefined | |
shape (optional) | Shape | undefined | |
seed (optional) | string | undefined | |
challengeJumps (optional) | number | undefined | |
language (optional) | "en" | "ja" | undefined | |
material (optional) | Material | undefined | |
theme (optional) | Partial<Theme> | undefined | |
justBoard (optional) | boolean | undefined | |
settingsHost (optional) | HTMLElement | undefined | |
onChange (optional) | ((game: Game, code: string) => void) | undefined |
Examples
import { makeBoard, newGame } from "@johnmorrisdotca/tobiishi";
import type { MountOptions } from "@johnmorrisdotca/tobiishi/play";
const board = makeBoard("Three holes",[{x:0,y:0},{x:1,y:0},{x:2,y:0}]);
const game = newGame(board,[true,true,false],2);
const value: MountOptions = {game,language:"ja",material:"glass"};
console.log(value);{
game: {
board: {
name: 'Three holes',
lattice: 'square',
cells: [Array],
jumps: [Array]
},
start: [ true, true, false ],
pegs: [ true, true, false ],
target: 2,
history: [],
helped: false
},
language: 'ja',
material: 'glass'
}What it prints (run when this page was built)