Reference · Playable number grid
mountShikakufunction
A rectangle player in any element; mount once, update appearance with set, destroy on unmount.
Import it
import { mountShikaku } from "@johnmorrisdotca/kazu/play";
Also exported from: @johnmorrisdotca/kazu/shikaku/play
Definition
function mountShikaku(host: HTMLElement, initial: ShikakuMountOptions): ShikakuMount
Parameters
| Name | Type | Description |
|---|---|---|
host | HTMLElement | The DOM host receiving the native player. |
initial | ShikakuMountOptions | The valid board, optional native progress, appearance and callbacks. |
Returns
ShikakuMount
A rectangle player in any element; mount once, update appearance with set, destroy on unmount.
Examples
import type { ShikakuBoard } from "@johnmorrisdotca/kazu/shikaku";
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 = mountShikaku(host,{board:shikakuBoard});
console.log(player.progress());
player.destroy();