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

cluesOffunction

Every clue a finished square makes true: what each side of it sees.

Import it

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

Definition

function cluesOf(solution: readonly number[], size: number): TowerClues

Parameters

NameTypeDescription
solutionreadonly number[]

The completed row-major numeric grid.

sizenumber

The supported square grid side length.

Returns

TowerClues

Every clue a finished square makes true: what each side of it sees.

Examples

import { cluesOf, decodeCells } from "@johnmorrisdotca/kazu";

console.log(cluesOf(decodeCells("1432214343213214",4)!,4));
{
  top: [ 3, 1, 2, 3 ],
  bottom: [ 2, 3, 3, 1 ],
  left: [ 2, 2, 1, 2 ],
  right: [ 3, 2, 4, 1 ]
}

What it prints (run when this page was built)

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