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

import { … } from "@johnmorrisdotca/kazu/play";

27.3 kB minified and gzipped, with everything it imports (measured with esbuild)

Kazu, played in a page: mountKazu draws a puzzle into any element and plays it by touch, mouse and keyboard, with a number pad, pencil marks, Undo, Hint, Check and a clock, and the words in English and Japanese. A separate entry (@johnmorrisdotca/kazu/play), so a server never loads any of it.

Exports

NameKindWhat it is
ensureKazuPlayStylefunctionPut the style in the page once: in the document's head, or in the shadow root the host is in.
KAZU_PLAY_STYLEconstantTHE STYLE a playable Kazu board wears (mountKazu, <kazu-board>): the drawing's own (KAZU_STYLE) and the board's box, its number pad, its buttons and its lines of words.
kazuClockTextfunctionA time taken, as a clock shows it: m:ss, and h:mm:ss past an hour.
KazuEventDetailtypeWhat every event tells of the board.
KazuMounttypeThe native mounted number grid, its current game/detail, controls and cleanup methods.
KazuMountOptionstypeThe puzzle, optional solution/progress, assistance, controls and event callbacks for mounting a number grid.
KazuMountSettingstypeEverything about how a mounted board plays that can change while it is on the page.
mountKazufunctionDraw a puzzle into host and play it.
mountShikakufunctionA rectangle player in any element; mount once, update appearance with set, destroy on unmount.
SHIKAKU_PLAY_STYLEconstantScoped native Shikaku board and player CSS.
SHIKAKU_STRINGSconstantNative English and Japanese labels and announcements for Shikaku.
ShikakuDrawOptionstypeCurrent Shikaku marks or entries, selection, errors and native SVG appearance choices.
ShikakuLanguagetypeThe native English or Japanese display language for Shikaku.
ShikakuMaterialtypeA supported material of the native Shikaku board.
ShikakuMounttypeThe mounted Shikaku game and progress, native controls and cleanup handle.
ShikakuMountOptionstypeThe initial Shikaku board, native progress, appearance and host event callbacks.
ShikakuPiecestypeA supported native Shikaku mark or piece appearance.

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