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

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

7.7 kB minified and gzipped, with everything it imports (measured with esbuild)

Awase (合わせ, "matching"): the matching solitaire. Take away the tiles two at a time, two that match and that are both free (nothing on top, and an open side), until the layout is clear. A deal is made from a seed at three levels, every one of them clearable, and a finished game is checked in one pass.

Exports

NameKindWhat it is
AWASE_CHALLENGE_NUMBERSconstantThe numbers every challenge is made from.
AWASE_CHALLENGESconstantAWASE WITH RULES YOU CHOOSE: options a game may be given (hints, shuffles and undo given, limited or taken away) and the challenges worth playing a deal for.
AWASE_SAME_BLOCKconstantTHE SEEDS OF THE IDENTICAL RULE, a block no other seed of this puzzle uses: a kept run is found by its seed, so the seed is what can say which rule a deal was made under without a column of its own (as a Futago's does).
AwaseChallengetypeA challenge's name.
AwaseChecktypeWhat a check of a finished game says: cleared, or the first reason it is not.
AwaseDealtypeA deal of Awase: its layout's size, its level and seed, the tiles where they lie, and one way to clear them.
AwaseLeveltypeHow hard a deal of Awase is: the easiest of a seed's candidate deals to clear, the middle one, or the hardest.
AwaseOptionstypeWhat the options of a game say.
awaseRulesfunctionThe rules a game is played by.
AwaseRulestypeWhat a game is played by, worked out from its options and its challenge.
AwaseRuntypeA game of Awase, and what the challenge it is played as asks of it.
AwaseRunReadingtypeThe game as it stands, for a page to read: how the clock, the goal and the hunt are going, without working them out again.
bonusRuleOfSeedfunctionThe native matching rule encoded by a seed: identical bonuses in the reserved block, grouped bonuses otherwise.
checkAwasefunctionWhether a solve clears a Mahjong deal: the check the browser makes to say "cleared" and the server makes before it pays.
clearRatefunctionHow often a player taking any free pair at random clears this deal, out of times.
dailyAwasefunctionTHE DAY'S GAME, the same for everybody on the same date: a layout, a level, a seed and a challenge worked out from the date alone (2026-10-01, or a Date, in UTC), so no server need hold it.
freshAwaseSeedfunctionA new seed for a deal under this rule: inside AWASE_SAME_BLOCK for the identical rule, anywhere else from 1 to SEED_MOST for the usual one.
generateAwasefunctionA deal of this layout at this level, made from this seed.
isAwaseChallengefunctionWhether a text names a challenge.
PURGE_GROUPSconstantThe groups a purge may name, each a set of tiles a layout is likely to hold plenty of.
readRunfunctionRead a game at at.
runHintfunctionAsk for a hint: the new game with it counted and the pair named, or null where none is left to use or no pair can be taken.
runMarkedfunctionThe tiles of the group the game is hunting for, as slots: the gold face, the purge's group, or nothing.
runMovesfunctionA game's moves written as encodeMoves writes them, with its seed, so it can be replayed on the deal.
runPairsfunctionEvery pair that may be taken now: none once the game is over.
runRemainingfunctionHow much time the game has left at at, in milliseconds; null for a game with no clock.
runShufflefunctionShuffle what is left, which is for when no pair can be taken: the new game, or null where it may not be (a pair can still be taken, none is left to use, or no shuffle would help).
runStartfunctionStart the clock, if the game has one and it has not started.
runTakefunctionTake a pair at at: the new game, or null where the rules do not allow it (the game is over, or the two are not a pair that may be taken).
runTickfunctionThe game as it stands at at: lost, if its time has run out.
runUndofunctionTake the last move back, where the rules allow undo: the new game, or null.
SEED_MOSTconstantThe most a seed can be: it travels in an address as a plain integer.
startRunfunctionStart a game of a deal.

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