Tiles型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 type { Tiles } from "@johnmorrisdotca/kumimoji";
定義
type Tiles = ReadonlyMap<string, string>;
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
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 |
例
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' }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。