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

AwaseRulestype

What a game is played by, worked out from its options and its challenge.

Import it

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

Definition

type AwaseRules = {
    challenge: AwaseChallenge | null;
    hints: number | null;
    shuffles: number | null;
    undo: boolean;
    timeMs: number | null;
    reserveMs: number | null;
    pairBonusMs: number;
    sparkBonusMs: number;
    comboBonusMs: number;
    goalPairs: number | null;
    goalScore: number | null;
    hideBlocked: boolean;
};

Members

NameTypeDescription
challenge"gold" | "spark" | "rush" | "fortune" | "sand" | "purge" | "blackout" | null
hintsnumber | null
shufflesnumber | null
undoboolean
timeMsnumber | null

The time a game starts with, in milliseconds; null for no clock.

reserveMsnumber | null

The most time a game may be holding: pairs add to a clock only up to this. Null for no limit.

pairBonusMsnumber

Time added by every pair, by a pair of the spark face, and for each step of a combo.

sparkBonusMsnumber
comboBonusMsnumber
goalPairsnumber | null

Pairs to make, or points to reach, to win without clearing the layout; null where the layout must be cleared (or the gold pair taken, or the group purged).

goalScorenumber | null
hideBlockedboolean

Only the free tiles show their faces: a page draws the blocked ones blank (hideBlocked).

Examples

import { awaseRules, generateAwase } from "@johnmorrisdotca/jarajara/awase";
import type { AwaseRules } from "@johnmorrisdotca/jarajara/awase";

const deal = generateAwase(4,"easy",2026);
const cells = deal.givens;
const value: AwaseRules = awaseRules(cells.length,{challenge:"rush"});
console.log(value);
{
  challenge: 'rush',
  hints: null,
  shuffles: null,
  undo: true,
  timeMs: 180000,
  reserveMs: null,
  pairBonusMs: 0,
  sparkBonusMs: 0,
  comboBonusMs: 0,
  goalPairs: 2,
  goalScore: null,
  hideBlocked: false
}

What it prints (run when this page was built)

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