Mini-games
eight games, validated on the server.
4.0 adds six mini-games to the memory and word games of 3.1: Merge, Tower stack, Math rush, Mini sudoku, Color sort and Reaction. They pay points only. The server creates each game and replays the result before it credits anything.
01The six new games
From docs/CONTRACT-4.0.md §7 and the engines in firebase/functions/src/games4/ (mirrored in Dart in app/lib/games/engine/, with shared test vectors in docs/game-vectors.json). The art is drawn in code; there are no image assets.
| Game (id) | How to play | A win is |
|---|---|---|
Merge (merge) | 2048-style on a 4×4 board: swipe to merge equal tiles. | Reaching the target tile (default 256). The server replays every move from the seed. |
Tower stack (stack) | A block slides back and forth; tap to drop it on the tower. The overhang is cut off. | A tower of at least the target height (default 15 blocks, at most 50). |
Math rush (math) | Answer as many sums as you can in 60 seconds. | At least the target number of correct answers (default 10). Games longer than 65 seconds are refused. |
Mini sudoku (sudoku) | A 6×6 sudoku (boxes of 2×3). | The correct solution of that puzzle. |
Color sort (sort) | Move balls between tubes until each tube holds one colour. | A solved puzzle, checked by replaying the moves. |
Reaction (reaction) | Tap the target as fast as you can, 10 rounds. | All 10 rounds with an average under the target (default 650 ms). Any tap under 120 ms is refused as not human. |
They appear on the Play tab next to the lucky wheel, scratch cards, memory and word games. The memory and word games are unchanged (Engagement features).
02Settings and defaults
Console → Mystery box and mini-games, one group per game (games.<id>, admin/src/manifest40.ts; defaults equal firebase/functions/src/config.ts):
| Game | On | Points per win | Credited wins per day | VIP only | Shortest credited game | Target |
|---|---|---|---|---|---|---|
| Merge | on | 20 | 5 | off | 15 000 ms | 256 (tile) |
| Tower stack | on | 15 | 5 | off | 5 000 ms | 15 (blocks) |
| Math rush | on | 15 | 5 | off | 20 000 ms | 10 (correct answers) |
| Mini sudoku | on | 20 | 5 | off | 30 000 ms | 0 (not used) |
| Color sort | on | 15 | 5 | off | 10 000 ms | 0 (not used) |
| Reaction | on | 10 | 5 | off | 3 000 ms | 650 (average ms, must be under) |
- Points per win: 0 to 10000. Points only; games never pay cash (hard rule). The VIP or booster multiplier applies, like for the 3.1 games.
- Credited wins per day: per user and game, UTC day. After the limit the app shows "That's all the rewarded games for today" and a new game is not started.
- VIP only: the card shows a lock for non-VIP users and the server refuses them (reason
vip_only). - Shortest credited game: a game finished faster than this, measured on the server since
startGame, earns nothing (anti-bot). - Features → Mini-games switches all games off at once.
The backend uses a target only inside its own range and otherwise falls back to the default: Merge 8 to 65536 (use a power of two, as the console help says), Tower stack 1 to 50, Math rush 1 to 80, Reaction 121 to 10000 ms (firebase/functions/src/games4/). The console accepts up to 200 for Tower stack and up to 100 for Math rush; a value above 50 or 80 is silently replaced by the default (15 or 10). Stay inside the backend ranges.
03How a game is checked
- StartThe app calls
startGame({game}). The server checks the switches, the VIP rule and today's wins, picks a random seed and returns the start of the game (the puzzle, the questions, the block speeds). Only Merge also receives the seed, because its new tiles come from it; for the other games the seed stays on the server so the app cannot work out the solution. - PlayThe game runs in the app.
- FinishThe app sends the moves, taps or answers to
finishGame. The server regenerates the game from the seed and replays them with the same code the app uses (samemulberry32generator in TypeScript and Dart). - CreditOnly a valid, plausible win within the daily limit is credited, once, as ledger type
game. A mismatch earns nothing and the user just sees "try again". A game expires after 30 minutes.
After a win the app may offer a rewarded interstitial or count a natural break for interstitials, as for the other games (Placements). Wins count towards the games achievements.
04In the web demo
With DEMO_MODE=true the games run fully on the device with the same generators and validators. The points shown are demo points; nothing is sent anywhere.