Skip to the content

Kazu数

Generate checked Sudoku and logic puzzles, read native rules and hints, and draw or embed playable boards.

Kazu is the Japanese word 数 for number. About the name

Contents

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

NameTypeDescription
hostHTMLElement

The DOM host receiving the native player.

initialShikakuMountOptions

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();

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kazu 2.1.0.