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 · Shared Awase table

AwaseTabletype

A GAME AT THE TABLE, as it is kept: the deal, who sits where, and every pair taken, in order. Everything else — whose turn it is, the scores, the shuffles, the end — is read again from these by readTable, so a game read back out of storage is exactly the game its pairs make, or none.

Import it

import type { AwaseTable } from "@johnmorrisdotca/jarajara/table";

Definition

type AwaseTable = {
    size: number;
    level: AwaseLevel;
    seed: number;
    givens: string;
    seats: readonly AwaseSeat[];
    takes: readonly (readonly [
        number,
        number
    ])[];
};

Members

NameTypeDescription
sizenumber
levelAwaseLevel
seednumber
givensstring

The deal, as the solo game writes it: a face a slot (tiles.ts).

seatsreadonly AwaseSeat[]
takesreadonly (readonly [number, number])[]

Every pair taken, by its two slots, in the order they were taken.

Examples

import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { startTable } from "@johnmorrisdotca/jarajara/table";
import type { AwaseTable } from "@johnmorrisdotca/jarajara/table";

const deal = generateAwase(4,"easy",2026);
const table = startTable(deal,[{name:"Seat 1"},{name:"Seat 2"}]);
const value: AwaseTable = table;
console.log(value);
{
  size: 4,
  level: 'easy',
  seed: 2026,
  givens: 'xPNxDBBD',
  seats: [ { name: 'Seat 1' }, { name: 'Seat 2' } ],
  takes: []
}

What it prints (run when this page was built)

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