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 · Shikaku rules

generateShikakufunction

Seeded rectangles packed into the board, one number each, with an independently counted, unique answer. The board is rated by solving it: easy by the first two rules (a number with one fitting rectangle, a square one rectangle can cover), medium once the third rule is needed too, hard by supposing, extra-hard the most-supposing of several boards. If no board of the level is found within the attempts the next level down is tried, and the first generator is the last resort.

Import it

import { generateShikaku } from "@johnmorrisdotca/kazu/shikaku";

Also exported from: @johnmorrisdotca/kazu

Definition

function generateShikaku(width?: number, height?: number, level?: ShikakuLevel, seed?: number): ShikakuPuzzle

Parameters

NameTypeDescription
width (optional)number

The supported board width in cells.

height (optional)number

The supported board height in cells.

level (optional)ShikakuLevel

The requested native difficulty tier.

seed (optional)number

The reproducible native puzzle seed.

Returns

ShikakuPuzzle

Seeded rectangles packed into the board, one number each, with an independently counted, unique answer. The board is rated by solving it: easy by the first two rules (a number with one fitting rectangle, a square one rectangle can cover), medium once the third rule is needed too, hard by supposing, extra-hard the most-supposing of several boards. If no board of the level is found within the attempts the next level down is tried, and the first generator is the last resort.

Examples

import { generateShikaku } from "@johnmorrisdotca/kazu/shikaku";

console.log(generateShikaku(5,5,"easy",42));

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