countTiles関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How many of each face a list of tiles holds, by code; faces it holds none of are left out.
インポート
import { countTiles } from "@johnmorrisdotca/jarajara";
定義
function countTiles(codes: Iterable<string>): Map<string, number>
引数
| 名前 | 型 | 説明 |
|---|---|---|
codes | Iterable<string> | The tile face codes in current order. |
戻り値
Map<string, number>
How many of each face a list of tiles holds, by code; faces it holds none of are left out.
例
import { countTiles } from "@johnmorrisdotca/jarajara";
console.log([...countTiles(["a","a","b"])]);[ [ 'a', 2 ], [ 'b', 1 ] ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。