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

groupStartsfunction

The places in a list, already in order, where a new group starts: every place whose tile is of another suit (or kind) than the one before it.

Import it

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

Definition

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

Parameters

NameTypeDescription
codesreadonly string[]

The tile face codes in current order.

by (optional)TileGrouping

The native grouping mode.

Returns

number[]

The places in a list, already in order, where a new group starts: every place whose tile is of another suit (or kind) than the one before it.

Examples

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

console.log(groupStarts(["a","b","F"],"suit"));
[ 2 ]

What it prints (run when this page was built)

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