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

MahjongLayouttype

A stacked layout: its slots in reading order (layer by layer, row by row), which is the order a deal is written in.

Import it

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

Definition

type MahjongLayout = {
    size: number;
    key: string;
    slots: readonly MahjongSlot[];
};

Members

NameTypeDescription
sizenumber

The layout's width in tiles: its "size", unique among the layouts.

keystring
slotsreadonly MahjongSlot[]

Examples

import { layoutFor } from "@johnmorrisdotca/jarajara";
import type { MahjongLayout } from "@johnmorrisdotca/jarajara";

const layout = layoutFor(4)!;
const value: MahjongLayout = layout;
console.log(value);
{
  size: 4,
  key: 'tiny',
  slots: [
    { x: 0, y: 0, z: 0 },
    { x: 2, y: 0, z: 0 },
    { x: 4, y: 0, z: 0 },
    { x: 6, y: 0, z: 0 },
    { x: 1, y: 0, z: 1 },
    { x: 3, y: 0, z: 1 },
    { x: 5, y: 0, z: 1 },
    { x: 3, y: 0, z: 2 }
  ]
}

What it prints (run when this page was built)

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