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

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

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

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