Reference · Rules, tiles and records
readTileProgressfunction
The parts of a kept game, or null for a string that is not one: its shape only, with no bag to check it against.
Import it
import { readTileProgress } from "@johnmorrisdotca/kumimoji";
Definition
function readTileProgress(code: string): { taken: number; returned: string; hand: string[]; tiles: Map<string, string>; } | null
Parameters
| Name | Type | Description |
|---|---|---|
code | string | The encoded grid or progress text. |
Returns
{ taken: number; returned: string; hand: string[]; tiles: Map<string, string>; } | null
The parts of a kept game, or null for a string that is not one: its shape only, with no bag to check it against.
Examples
import { deal, encodeTileProgress, readTileProgress } from "@johnmorrisdotca/kumimoji";
const play = deal("catdog",3);
console.log(readTileProgress(encodeTileProgress(play)));{ taken: 3, returned: '', hand: [ 'c', 'a', 't' ], tiles: Map(0) {} }What it prints (run when this page was built)