Reference · Load level collections
nextTsunagiLevelfunction
The level to open on: the first open one not yet solved, or the last open one when every open level is solved.
Import it
import { nextTsunagiLevel } from "@johnmorrisdotca/tsunagi/levels";
Also exported from: @johnmorrisdotca/tsunagi
Definition
function nextTsunagiLevel(size: number, solved: ReadonlySet<number>, set?: TsunagiSet): number
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
The level to open on: the first open one not yet solved, or the last open one when every open level is solved.
Examples
import { nextTsunagiLevel } from "@johnmorrisdotca/tsunagi/levels";
console.log(nextTsunagiLevel(4,new Set([1,2])));3What it prints (run when this page was built)