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 · SVG faces and looks

redFiveIndexesfunction

WHICH TILES OF A LIST ARE THE RED FIVES. A set holds one red five of each suit, drawn in place of one of its four fives, and a face's letter cannot say which, so the first five of each suit in the list (in the layout's slot order, or the hand's) is the red one. A pure function of the tiles, so the same tiles are red every time.

Import it

import { redFiveIndexes } from "@johnmorrisdotca/jarajara/faces";

Definition

function redFiveIndexes(codes: Iterable<string>): Set<number>

Parameters

NameTypeDescription
codesIterable<string>

The tile face codes in current order.

Returns

Set<number>

WHICH TILES OF A LIST ARE THE RED FIVES. A set holds one red five of each suit, drawn in place of one of its four fives, and a face's letter cannot say which, so the first five of each suit in the list (in the layout's slot order, or the hand's) is the red one. A pure function of the tiles, so the same tiles are red every time.

Examples

import { redFiveIndexes } from "@johnmorrisdotca/jarajara/faces";

console.log([...redFiveIndexes(["e","e","n"])]);
[ 0, 2 ]

What it prints (run when this page was built)

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