Reference · Rules, tiles and records
Tilestype
A KUMIMOJI GRID: letter tiles on a table with no edges. Each tile stands on a square named by its row and column, which may be any whole numbers, negative too — the table grows whichever way the player builds. Pure, like every rule here: nothing is changed in place.
As a string, for an answer and a kept game, the grid is drawn from its own
top-left tile: its rows in order, joined by "/", each row written as runs of
empty squares (a number) and tiles. English letters keep their short form;
other tiles are URI-escaped between ~ and ;. cat/2o/2w is CAT across
and COW down from its C. Only
where the tiles stand beside one another is written, never where on the
table they were, so one grid has one spelling however far it was dragged.
Import it
import type { Tiles } from "@johnmorrisdotca/kumimoji";
Definition
type Tiles = ReadonlyMap<string, string>;
Members
| Name | Type | Description |
|---|---|---|
forEach | (callbackfn: (value: string, key: string, map: ReadonlyMap<string, string>) => void, thisArg?: any): void | |
get | (key: string): string | undefined | |
has | (key: string): boolean | |
size | number | |
entries | (): MapIterator<[string, string]> | Returns an iterable of key, value pairs for every entry in the map. |
keys | (): MapIterator<string> | Returns an iterable of keys in the map |
values | (): MapIterator<string> | Returns an iterable of values in the map |
Examples
import type { Tiles } from "@johnmorrisdotca/kumimoji";
const tiles = new Map([["0,0","c"],["0,1","a"],["0,2","t"]]);
const value: Tiles = tiles;
console.log(value);Map(3) { '0,0' => 'c', '0,1' => 'a', '0,2' => 't' }What it prints (run when this page was built)