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

checkAwasefunction

Whether a solve clears a Mahjong deal: the check the browser makes to say "cleared" and the server makes before it pays. It plays the moves on the deal — every pair two free tiles that match, every shuffle made only when no pair was left and drawn exactly as the rules draw it — and asks that the layout ends empty. A few thousand steps at most, and no search.

Import it

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

Definition

function checkAwase(size: number, givens: string, answer: string): AwaseCheck

Parameters

NameTypeDescription
sizenumber

The native layout size identifier, measured in tiles across.

givensstring

The original face-code deal in native slot order.

answerstring

The native move record claiming to clear the deal.

Returns

AwaseCheck

Whether a solve clears a Mahjong deal: the check the browser makes to say "cleared" and the server makes before it pays. It plays the moves on the deal — every pair two free tiles that match, every shuffle made only when no pair was left and drawn exactly as the rules draw it — and asks that the layout ends empty. A few thousand steps at most, and no search.

Examples

import { checkAwase, generateAwase } from "@johnmorrisdotca/jarajara/awase";

const deal = generateAwase(4,"easy",2026);
console.log(checkAwase(4,deal.givens,deal.solution));
{ ok: true }

What it prints (run when this page was built)

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