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

MahjongGeometrytype

What stands on and beside each slot, worked out once per layout: the slots over it (any higher layer overlapping it), and the slots touching its left and right sides on its own layer.

Import it

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

Definition

type MahjongGeometry = {
    layout: MahjongLayout;
    above: readonly (readonly number[])[];
    left: readonly (readonly number[])[];
    right: readonly (readonly number[])[];
};

Members

NameTypeDescription
layoutMahjongLayout
abovereadonly (readonly number[])[]
leftreadonly (readonly number[])[]
rightreadonly (readonly number[])[]

Examples

import { geometryOf, layoutFor } from "@johnmorrisdotca/jarajara";
import type { MahjongGeometry } from "@johnmorrisdotca/jarajara";

const layout = layoutFor(4)!;
const geometry = geometryOf(layout);
const value: MahjongGeometry = geometry;
console.log(value);
{
  layout: {
    size: 4,
    key: 'tiny',
    slots: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object]
    ]
  },
  above: [ [ 4 ], [ 4, 5, 7 ], [ 5, 6, 7 ], [ 6 ], [], [ 7 ], [], [] ],
  left: [
    [],    [ 0 ], [ 1 ],
    [ 2 ], [],    [ 4 ],
    [ 5 ], []
  ],
  right: [
    [ 1 ], [ 2 ], [ 3 ],
    [],    [ 5 ], [ 6 ],
    [],    []
  ]
}

What it prints (run when this page was built)

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