Reference · Playable number grid
ShikakuMounttype
The mounted Shikaku game and progress, native controls and cleanup handle.
Import it
import type { ShikakuMount } from "@johnmorrisdotca/kazu/play";
Also exported from: @johnmorrisdotca/kazu/shikaku/play
Definition
type ShikakuMount = {
game: () => ShikakuGame;
progress: () => string;
set: (options: ShikakuDrawOptions) => void;
restart: () => void;
destroy: () => void;
};
Members
| Name | Type | Description |
|---|---|---|
game | () => ShikakuGame | |
progress | () => string | |
set | (options: ShikakuDrawOptions) => void | |
restart | () => void | |
destroy | () => void |
Examples
import type { ShikakuBoard } from "@johnmorrisdotca/kazu/shikaku";
import type { ShikakuMount } from "@johnmorrisdotca/kazu/play";
import { mountShikaku } from "@johnmorrisdotca/kazu/play";
const shikakuBoard: ShikakuBoard = {"width":5,"height":5,"clues":[3,0,0,0,2,0,0,0,0,4,0,0,0,0,0,0,0,0,0,3,4,3,6,0,0]};
const host = document.createElement("div");
document.body.append(host);
const player: ShikakuMount = mountShikaku(host,{board:shikakuBoard});
console.log(player.progress());
player.destroy();