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
| Name | Type | Description |
|---|---|---|
entries (optional) | readonly number[] | undefined | Entries to start from: a run kept half done ( |
notes (optional) | readonly number[] | undefined | Pencil marks to start from ( |
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)