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
| Name | Type | Description |
|---|---|---|
size | number | The native layout size identifier, measured in tiles across. |
givens | string | The original face-code deal in native slot order. |
answer | string | 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)