Reference · Number-puzzle engines
KazuPuzzletype
One puzzle, made from a seed or read back from its codes. givens and solution are the strings
cells.ts and the kinds' own codes write: row-major cells, one character each, and for a Jigsaw, Sum
Cages, More or Less or Towers the rest of what the puzzle is printed with, after the cells.
Import it
import type { KazuPuzzle } from "@johnmorrisdotca/kazu";
Definition
type KazuPuzzle = {
kind: KazuKind;
size: number;
level: KazuLevel;
seed: number;
givens: string;
solution: string;
};
Members
| Name | Type | Description |
|---|---|---|
kind | "number-place" | "jigsaw" | "diagonal" | "sum-cages" | "more-or-less" | "towers" | |
size | number | |
level | "easy" | "medium" | "hard" | |
seed | number | |
givens | string | |
solution | string |
Examples
import type { KazuPuzzle } from "@johnmorrisdotca/kazu";
const puzzle: KazuPuzzle = {"kind":"number-place","size":4,"level":"easy","seed":42,"givens":"14..2..1412.3..4","solution":"1432234141233214"};
const value: KazuPuzzle = puzzle;
console.log(value);{
kind: 'number-place',
size: 4,
level: 'easy',
seed: 42,
givens: '14..2..1412.3..4',
solution: '1432234141233214'
}What it prints (run when this page was built)