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-puzzle engines

KazuGameOptionstype

Optional entries and pencil-note masks to restore when creating a native number-grid game.

Import it

import type { KazuGameOptions } from "@johnmorrisdotca/kazu";

Definition

type KazuGameOptions = {
    entries?: readonly number[];
    notes?: readonly number[];
};

Members

NameTypeDescription
entries (optional)readonly number[] | undefined

Entries to start from: a run kept half done (decodeRun). Printed cells are ignored.

notes (optional)readonly number[] | undefined

Pencil marks to start from (decodeNotes).

Examples

import type { KazuGameOptions, KazuPuzzle } from "@johnmorrisdotca/kazu";
import { newKazuGame } from "@johnmorrisdotca/kazu";

const puzzle: KazuPuzzle = {"kind":"number-place","size":4,"level":"easy","seed":42,"givens":"14..2..1412.3..4","solution":"1432234141233214"};
const kind = puzzle.kind;
const size = puzzle.size;
const givens = puzzle.givens;
const game = newKazuGame(kind,size,givens)!;
const value: KazuGameOptions = {entries:game.entries,notes:game.notes};
console.log(value);
{
  entries: [
    0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0,
    0, 0, 0, 0
  ],
  notes: [
    0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0,
    0, 0, 0, 0
  ]
}

What it prints (run when this page was built)

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