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

describeSlotfunction

Where a slot is, in tiles: across and down from the layout's corner (halves where a tile sits between two), and which layer, from 1.

Import it

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

Definition

function describeSlot(layout: MahjongLayout, index: number): { x: number; y: number; z: number; } | null

Parameters

NameTypeDescription
layoutMahjongLayout

The native stacked tile positions.

indexnumber

The shuffle count or slot index specified by the signature.

Returns

{ x: number; y: number; z: number; } | null

The slot’s tile coordinates and one-based layer, or null for an out-of-range slot index.

Examples

import { describeSlot, layoutFor } from "@johnmorrisdotca/jarajara";

const layout = layoutFor(4)!;
console.log(describeSlot(layout,0));
{ x: 0, y: 0, z: 1 }

What it prints (run when this page was built)

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