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

decodeRegionsfunction

Regions row-major, one letter each, or null for a string that is not that.

Import it

import { decodeRegions } from "@johnmorrisdotca/kazu";

Definition

function decodeRegions(code: string, size: number): number[] | null

Parameters

NameTypeDescription
codestring

The native encoded clues, entries or notes specified by the signature.

sizenumber

The supported square grid side length.

Returns

number[] | null

Regions row-major, one letter each, or null for a string that is not that.

Examples

import { decodeJigsaw, decodeRegions, encodeRegions } from "@johnmorrisdotca/kazu";

const jigsaw = decodeJigsaw(".1.34....33..12...45423..bbaaacbaaecbeeecbddeccddd",5)!;
console.log(decodeRegions(encodeRegions(jigsaw.regions),5)?.length);
25

What it prints (run when this page was built)

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