Reference · Rules, tiles and records
unpackLengthfunction
Front-coded words of one length read back (see scripts/tile-words.mjs): a shared-prefix character, then the rest.
Import it
import { unpackLength } from "@johnmorrisdotca/kumimoji";
Definition
function unpackLength(packed: string, length: number): string[]
Parameters
| Name | Type | Description |
|---|---|---|
packed | string | The front-coded words of one fixed length. |
length | number | The game length or decoded word length, as declared. |
Returns
string[]
Front-coded words of one length read back (see scripts/tile-words.mjs): a shared-prefix character, then the rest.
Examples
import { unpackLength } from "@johnmorrisdotca/kumimoji";
console.log(unpackLength("0cat2r",3));[ 'cat', 'car' ]What it prints (run when this page was built)