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

groupTilesfunction

The tiles split into the runs a gap is drawn between: by suit or by kind, each run in the set's order.

Import it

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

Definition

function groupTiles(codes: readonly string[], by?: TileGrouping): string[][]

Parameters

NameTypeDescription
codesreadonly string[]

The tile face codes in current order.

by (optional)TileGrouping

The native grouping mode.

Returns

string[][]

The tiles split into the runs a gap is drawn between: by suit or by kind, each run in the set's order.

Examples

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

console.log(groupTiles(["a","b","F"],"suit"));
[ [ 'a', 'b' ], [ 'F' ] ]

What it prints (run when this page was built)

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