本文へ移動

Jarajaraジャラジャラ

麻雀牌を描き、手牌や積み重ねた盤を配置し、シード付きの「合わせ」をひとりでも対戦卓でも遊べます。

「ジャラジャラ」は麻雀牌が触れ合う音を表す言葉です。 名前について(英語)

目次

リファレンス

合わせのひとり遊び

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

最小化と gzip 圧縮をしたサイズは 7.7 kB(読み込むものをすべて含み、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.

エクスポート

名前種類概要
AWASE_CHALLENGE_NUMBERS定数The numbers every challenge is made from.
AWASE_CHALLENGES定数AWASE 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_BLOCK定数THE 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).
AwaseChallenge型A challenge's name.
AwaseCheck型What a check of a finished game says: cleared, or the first reason it is not.
AwaseDeal型A deal of Awase: its layout's size, its level and seed, the tiles where they lie, and one way to clear them.
AwaseLevel型How hard a deal of Awase is: the easiest of a seed's candidate deals to clear, the middle one, or the hardest.
AwaseOptions型What the options of a game say.
awaseRules関数The rules a game is played by.
AwaseRules型What a game is played by, worked out from its options and its challenge.
AwaseRun型A game of Awase, and what the challenge it is played as asks of it.
AwaseRunReading型The game as it stands, for a page to read: how the clock, the goal and the hunt are going, without working them out again.
bonusRuleOfSeed関数The native matching rule encoded by a seed: identical bonuses in the reserved block, grouped bonuses otherwise.
checkAwase関数Whether a solve clears a Mahjong deal: the check the browser makes to say "cleared" and the server makes before it pays.
clearRate関数How often a player taking any free pair at random clears this deal, out of times.
dailyAwase関数THE 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.
freshAwaseSeed関数A 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.
generateAwase関数A deal of this layout at this level, made from this seed.
isAwaseChallenge関数Whether a text names a challenge.
PURGE_GROUPS定数The groups a purge may name, each a set of tiles a layout is likely to hold plenty of.
readRun関数Read a game at at.
runHint関数Ask 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.
runMarked関数The tiles of the group the game is hunting for, as slots: the gold face, the purge's group, or nothing.
runMoves関数A game's moves written as encodeMoves writes them, with its seed, so it can be replayed on the deal.
runPairs関数Every pair that may be taken now: none once the game is over.
runRemaining関数How much time the game has left at at, in milliseconds; null for a game with no clock.
runShuffle関数Shuffle 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).
runStart関数Start the clock, if the game has one and it has not started.
runTake関数Take 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).
runTick関数The game as it stands at at: lost, if its time has run out.
runUndo関数Take the last move back, where the rules allow undo: the new game, or null.
SEED_MOST定数The most a seed can be: it travels in an address as a plain integer.
startRun関数Start a game of a deal.

ソースを見るGitHub で編集@johnmorrisdotca/jarajara 1.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。