Reference · Number-puzzle engines
encodeRegionsfunction
The region of every cell as a letter, a for the first region and so on: one character a cell.
Import it
import { encodeRegions } from "@johnmorrisdotca/kazu";
Definition
function encodeRegions(regions: readonly number[]): string
Parameters
| Name | Type | Description |
|---|---|---|
regions | readonly number[] | The row-major region index of every cell. |
Returns
string
The region of every cell as a letter, a for the first region and so on: one character a cell.
Examples
import { decodeJigsaw, encodeRegions } from "@johnmorrisdotca/kazu";
const jigsaw = decodeJigsaw(".1.34....33..12...45423..bbaaacbaaecbeeecbddeccddd",5)!;
console.log(encodeRegions(jigsaw.regions));bbaaacbaaecbeeecbddeccdddWhat it prints (run when this page was built)