Reference · Load level collections
firstUnsolvedTsunagiLevelfunction
The lowest level not yet solved, or null when every level of the size is. It is always open: a block opens only once the block before is all solved, so the first gap is in the open blocks. Nobody is sent past a level they have not finished.
Import it
import { firstUnsolvedTsunagiLevel } from "@johnmorrisdotca/tsunagi/levels";
Also exported from: @johnmorrisdotca/tsunagi
Definition
function firstUnsolvedTsunagiLevel(size: number, solved: ReadonlySet<number>, set?: TsunagiSet): number | null
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The number of cells on each side of the board. |
solved | ReadonlySet<number> | Solved level numbers, or the solver metrics specified by this signature. |
set (optional) | TsunagiSet | The native level set or palette specified by the signature. |
Returns
number | null
The lowest level not yet solved, or null when every level of the size is. It is always open: a block opens only once the block before is all solved, so the first gap is in the open blocks. Nobody is sent past a level they have not finished.
Examples
import { firstUnsolvedTsunagiLevel } from "@johnmorrisdotca/tsunagi/levels";
console.log(firstUnsolvedTsunagiLevel(4,new Set([1,2])));3What it prints (run when this page was built)