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

ShikakuMountOptionstype

The initial Shikaku board, native progress, appearance and host event callbacks.

Import it

import type { ShikakuMountOptions } from "@johnmorrisdotca/kazu/play";

Also exported from: @johnmorrisdotca/kazu/shikaku/play

Definition

type ShikakuMountOptions = ShikakuDrawOptions & {
    board: ShikakuBoard;
    progress?: string;
    onChange?: (game: ShikakuGame) => void;
    onFinish?: (game: ShikakuGame) => void;
};

Members

NameTypeDescription
rectangles (optional)readonly ShikakuRectangle[] | undefined
selected (optional)number | null | undefined
anchor (optional)number | null | undefined
errors (optional)readonly number[] | undefined
material (optional)ShikakuMaterial | undefined
pieces (optional)ShikakuPieces | undefined
language (optional)ShikakuLanguage | undefined
boardShikakuBoard
progress (optional)string | undefined
onChange (optional)((game: ShikakuGame) => void) | undefined
onFinish (optional)((game: ShikakuGame) => void) | undefined

Examples

import type { ShikakuBoard } from "@johnmorrisdotca/kazu/shikaku";
import type { ShikakuMountOptions } 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 value: ShikakuMountOptions = {board:shikakuBoard};
console.log(value);
{
  board: {
    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
    ]
  }
}

What it prints (run when this page was built)

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