リファレンス
合わせのひとり遊び
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。