TsunagiMountOptionstype
The puzzle, native display choices, controls and event callbacks for mounting a board.
Import it
import type { TsunagiMountOptions } from "@johnmorrisdotca/tsunagi/play";
Definition
type TsunagiMountOptions = TsunagiLook & {
size: number;
givens: string;
answer?: string;
level?: number;
set?: TsunagiSet;
lines?: Lines;
explosions?: TsunagiExplosionChoice;
cheats?: boolean;
controls?: boolean;
chips?: boolean;
zoom?: "auto" | "on" | "off";
language?: TsunagiLanguage;
onChange?: (detail: TsunagiEventDetail) => void;
onStroke?: (detail: TsunagiEventDetail) => void;
onExplosion?: (detail: TsunagiEventDetail) => void;
onSolve?: (detail: TsunagiEventDetail) => void;
};
Members
| Name | Type | Description |
|---|---|---|
marks (optional) | TsunagiMarks | undefined | |
fill (optional) | TsunagiFill | undefined | |
colours (optional) | "marble" | "bright" | "colour-blind" | "soft" | readonly TsunagiColour[] | undefined | |
board (optional) | "paper" | "wood" | "green" | "blue" | "red" | "black" | TsunagiBoardLook | undefined | |
coordinates (optional) | boolean | undefined | |
size | number | The board's size: how many cells across. |
givens | string | The level's layout code. |
answer (optional) | string | undefined | The level's one answer, as a code. With it a solve must be that answer, and Cheat can be offered. |
level (optional) | number | undefined | Which level of its size this is, to show its difficulty and its place in its block. |
set (optional) | TsunagiSet | undefined | Which set of levels |
lines (optional) | Lines | undefined | Lines to start from, to carry on a game kept half played. |
explosions (optional) | TsunagiExplosionChoice | undefined | Explosions as made (the default), softened or off. |
cheats (optional) | boolean | undefined | Offer Cheat, which draws one unfinished line. Needs |
controls (optional) | boolean | undefined | The buttons and the lines of words under the board. Default true. |
chips (optional) | boolean | undefined | A row of chips under the board: the level's difficulty and each challenge on it, each with the line that explains it when pressed. Default false. |
zoom (optional) | "on" | "off" | "auto" | undefined |
|
language (optional) | TsunagiLanguage | undefined | The language the words are in. Left out, the host's own |
onChange (optional) | ((detail: TsunagiEventDetail) => void) | undefined | |
onStroke (optional) | ((detail: TsunagiEventDetail) => void) | undefined | |
onExplosion (optional) | ((detail: TsunagiEventDetail) => void) | undefined | |
onSolve (optional) | ((detail: TsunagiEventDetail) => void) | undefined |
Examples
import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import type { TsunagiMountOptions } from "@johnmorrisdotca/tsunagi/play";
const givens = TSUNAGI_4[0][0];
const answer = TSUNAGI_4[0][1];
const value: TsunagiMountOptions = {size:4,givens,answer,controls:true};
console.log(value);{
size: 4,
givens: 'A..AB..BC..CD..D',
answer: 'AAAABBBBCCCCDDDD',
controls: true
}What it prints (run when this page was built)