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

shuffledfunction

A copy of the list in a random order (Fisher–Yates); the list given is left alone.

Import it

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

Definition

function shuffled<T>(items: readonly T[], random: Random): T[]

Parameters

NameTypeDescription
itemsreadonly T[]

The items to copy and shuffle.

randomRandom

A reproducible random source returning values in [0,1).

Returns

T[]

A copy of the list in a random order (Fisher–Yates); the list given is left alone.

Examples

import { seededRandom, shuffled } from "@johnmorrisdotca/jarajara";

console.log(shuffled(["a","b","c"],seededRandom(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.