Skip to the content

Jarajaraジャラジャラ

Draw mahjong tiles, arrange racks and stacked boards, and play seeded Awase alone or at a shared table.

Jarajara is the Japanese sound of mahjong tiles rattling together. About the name

Contents

Reference · Tiles, layouts and deals

countTilesfunction

How many of each face a list of tiles holds, by code; faces it holds none of are left out.

Import it

import { countTiles } from "@johnmorrisdotca/jarajara";

Definition

function countTiles(codes: Iterable<string>): Map<string, number>

Parameters

NameTypeDescription
codesIterable<string>

The tile face codes in current order.

Returns

Map<string, number>

How many of each face a list of tiles holds, by code; faces it holds none of are left out.

Examples

import { countTiles } from "@johnmorrisdotca/jarajara";

console.log([...countTiles(["a","a","b"])]);
[ [ 'a', 2 ], [ 'b', 1 ] ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/jarajara 1.7.0.