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
| Name | Type | Description |
|---|---|---|
solution | readonly number[] | The completed row-major numeric grid. |
size | number | 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)