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 · Awase solitaire

AwaseRunReadingtype

The game as it stands, for a page to read: how the clock, the goal and the hunt are going, without working them out again.

Import it

import type { AwaseRunReading } from "@johnmorrisdotca/jarajara/awase";

Definition

type AwaseRunReading = {
    state: "run" | "won" | "lost";
    because: AwaseRun["because"];
    tilesLeft: number;
    pairsFree: number;
    remainingMs: number | null;
    goal: {
        kind: "pairs" | "score" | "purge" | "gold" | "spark" | "clear";
        done: number;
        of: number;
    } | null;
    multiplier: number;
};

Members

NameTypeDescription
state"won" | "lost" | "run"
because"gold" | "cleared" | "goal" | "purged" | "time" | "stuck" | null
tilesLeftnumber
pairsFreenumber
remainingMsnumber | null
goal{ kind: "pairs" | "score" | "purge" | "gold" | "spark" | "clear"; done: number; of: number; } | null

Progress towards what the challenge asks: pairs of the goal, points of the goal, or tiles of the group left.

multipliernumber

Examples

import { generateAwase, readRun, startRun } from "@johnmorrisdotca/jarajara/awase";
import type { AwaseRunReading } from "@johnmorrisdotca/jarajara/awase";

const deal = generateAwase(4,"easy",2026);
const run = startRun(deal,{},0);
const value: AwaseRunReading = readRun(run,1000);
console.log(value);
{
  state: 'run',
  because: null,
  tilesLeft: 8,
  pairsFree: 1,
  remainingMs: null,
  goal: null,
  multiplier: 1
}

What it prints (run when this page was built)

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