Reference · Load level collections
tsunagiLevelOffunction
The level a layout is, at a loaded size and set, or null for a layout no level has.
Import it
import { tsunagiLevelOf } from "@johnmorrisdotca/tsunagi/levels";
Definition
function tsunagiLevelOf(size: number, givens: string, set?: TsunagiSet): number | null
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The number of cells on each side of the board. |
givens | string | The original native layout code. |
set (optional) | TsunagiSet | The native level set or palette specified by the signature. |
Returns
number | null
The level a layout is, at a loaded size and set, or null for a layout no level has.
Examples
import { loadTsunagiLevels, tsunagiLevelOf } from "@johnmorrisdotca/tsunagi/levels";
import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
await loadTsunagiLevels(4);
const givens = TSUNAGI_4[0][0];
console.log(tsunagiLevelOf(4,givens));1What it prints (run when this page was built)