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 · Number-grid SVG

KazuDrawOptionstype

What a drawing shows beyond the puzzle itself. Every part is optional: a puzzle alone is its printed grid.

Import it

import type { KazuDrawOptions } from "@johnmorrisdotca/kazu/draw";

Definition

type KazuDrawOptions = {
    entries?: readonly number[];
    notes?: readonly number[];
    selected?: number | null;
    peers?: boolean;
    conflicts?: readonly number[];
    wrong?: readonly number[];
    hint?: number | null;
    done?: boolean;
    interactive?: boolean;
    language?: KazuLanguage;
    label?: string;
    style?: boolean;
    frame?: boolean;
};

Members

NameTypeDescription
entries (optional)readonly number[] | undefined

What the player has written, row-major, 0 for empty.

notes (optional)readonly number[] | undefined

Pencil marks, a bit mask a cell: bit v is the note v (notesOf).

selected (optional)number | null | undefined

The chosen cell.

peers (optional)boolean | undefined

Wash the chosen cell's row, column and group, and every cell holding its number.

conflicts (optional)readonly number[] | undefined

Cells that break a rule, drawn in red with their numbers (conflictsOf).

wrong (optional)readonly number[] | undefined

Cells Check flagged wrong.

hint (optional)number | null | undefined

The cell a hint pointed at.

done (optional)boolean | undefined

A faint wash of green, and data-solved="true".

interactive (optional)boolean | undefined

Put a transparent square over every cell, each with its data-cell, for a page to press on. mountKazu does.

language (optional)KazuLanguage | undefined

What a screen reader hears.

label (optional)string | undefined

A description instead of "Sudoku puzzle, 9 by 9".

style (optional)boolean | undefined

Put KAZU_STYLE inside, so the drawing stands alone as an image.

frame (optional)boolean | undefined

Draw the wooden frame round the paper. Default false.

Examples

import type { KazuDrawOptions } from "@johnmorrisdotca/kazu/draw";

const value: KazuDrawOptions = {language:"en",peers:true};
console.log(value);
{ language: 'en', peers: true }

What it prints (run when this page was built)

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