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

clearRatefunction

How often a player taking any free pair at random clears this deal, out of times.

Import it

import { clearRate } from "@johnmorrisdotca/jarajara/awase";

Definition

function clearRate(geometry: MahjongGeometry, cells: string, rule: MahjongBonusRule, random: Random, times: number): number

Parameters

NameTypeDescription
geometryMahjongGeometry

The stacked layout’s covering and side-blocking relationships.

cellsstring

The face-code string in native slot order; dot marks a removed tile.

ruleMahjongBonusRule

Grouped or identical bonus matching.

randomRandom

A reproducible random source returning values in [0,1).

timesnumber

The number of bounded random clear attempts to measure.

Returns

number

How often a player taking any free pair at random clears this deal, out of times.

Examples

import { clearRate, generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { geometryOf, layoutFor, seededRandom } from "@johnmorrisdotca/jarajara";

const deal = generateAwase(4,"easy",2026);
const layout = layoutFor(4)!;
const geometry = geometryOf(layout);
const cells = deal.givens;
console.log(clearRate(geometry,cells,"group",seededRandom(42),4));
1

What it prints (run when this page was built)

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