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

readTilesfunction

A LIST OF TILES AS TEXT, read the forgiving way: each word is a tile's name (east, red-dragon, 3p) or a run of one-letter codes (abcF), and hand notation (123m456p) is read as it is written. Words that are no tile are dropped, and so is ., the empty slot. A bare word that is a name wins over its letters, so east is the east wind and not four tiles.

Import it

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

Definition

function readTiles(text: string | null | undefined): string[]

Parameters

NameTypeDescription
textstring | null | undefined

The unknown text or encoded record to interpret.

Returns

string[]

A LIST OF TILES AS TEXT, read the forgiving way: each word is a tile's name (east, red-dragon, 3p) or a run of one-letter codes (abcF), and hand notation (123m456p) is read as it is written. Words that are no tile are dropped, and so is ., the empty slot. A bare word that is a name wins over its letters, so east is the east wind and not four tiles.

Examples

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

console.log(readTiles("123m456p"));
[ 'a', 'b', 'c', 'm', 'n', 'o' ]

What it prints (run when this page was built)

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