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

Laidtype

A deal laid out and the order it can be cleared in, pair by pair.

Import it

import type { Laid } from "@johnmorrisdotca/jarajara";

Definition

type Laid = {
    cells: MahjongCells;
    order: [
        number,
        number
    ][];
};

Members

NameTypeDescription
cellsstring
order[number, number][]

Examples

import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { geometryOf, layPairs, layoutFor, pairsLeft, seededRandom } from "@johnmorrisdotca/jarajara";
import type { Laid } from "@johnmorrisdotca/jarajara";

const deal = generateAwase(4,"easy",2026);
const layout = layoutFor(4)!;
const geometry = geometryOf(layout);
const cells = deal.givens;
const value: Laid = layPairs(geometry,layout.slots.map(()=>true),pairsLeft(cells,"group"),seededRandom(42))!;
console.log(value);
{
  cells: 'DxxNBPDB',
  order: [ [ 7, 4 ], [ 6, 0 ], [ 3, 5 ], [ 1, 2 ] ]
}

What it prints (run when this page was built)

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