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

mixTilesfunction

The same tiles in another order, at random, or the same order for the same seed; never the order they were in unless there is only one to be in.

Import it

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

Definition

function mixTiles(codes: readonly string[], seed?: number): string[]

Parameters

NameTypeDescription
codesreadonly string[]

The tile face codes in current order.

seed (optional)number | undefined

The numeric seed used to reproduce the deal or its matching rule.

Returns

string[]

The same tiles in another order, at random, or the same order for the same seed; never the order they were in unless there is only one to be in.

Examples

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

console.log(mixTiles(["a","b","c"],42));
[ 'c', 'a', 'b' ]

What it prints (run when this page was built)

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