Reef Pairs is a small daily logic puzzle on JumpBud. The board is a 4×5 grid of 20 tiles, each showing one of four shapes. You join neighboring tiles into dominoes, and every pair of shapes (circle–circle, circle–diamond, and so on) may be used exactly once. Four shapes give 4 doubles plus 6 mixed pairs, so 10 dominoes cover the 20 tiles.
The rule I care about most as the builder: every daily board has exactly one solution. If a puzzle has two answers, the player who finds the "other" one feels cheated, and any hint system becomes ambiguous. This post covers how small that search really is, why random boards almost never qualify, and how the game picks a board per day without a server.
The search space is tiny
Before thinking about shapes at all, how many ways can you tile a 4×5 rectangle with dominoes? A quick count gives 95. That is the whole space. Shapes only remove options from those 95 tilings, so a brute-force solver is not just acceptable here, it is the right tool.
The solver always fills the lowest free cell first. That cell can only pair with the cell to its right or the cell below it, because everything above and to the left is already covered. Free cells and used pairs both fit in plain bitmasks:
const COLS = 5, N = 20; function countSolutions(tiles, limit = Infinity) { const t = Array.from(tiles, Number); let free = (1 << N) - 1; // bit i = tile i still open let used = 0; // bit k = shape pair k already placed let found = 0; const pairKey = (a, b) => (a < b ? a * 4 + b : b * 4 + a); (function visit() { if (!free) { found++; return; } const first = 31 - Math.clz32(free & -free); // lowest open tile for (const second of [first + 1, first + COLS]) { if (second === first + 1 && first % COLS === COLS - 1) continue; // row edge if (second >= N || !((free >> second) & 1)) continue; const bit = 1 << pairKey(t[first], t[second]); if (used & bit) continue; // pair already on the board free &= ~((1 << first) | (1 << second)); used |= bit; visit(); free |= (1 << first) | (1 << second); used &= ~bit; if (found >= limit) return; } })(); return found; } Run over all 365 boards in the daily pool, the median board needs 39 search nodes (min 14, max 133), and the whole check costs about 0.035 ms per board in Node. The repo also has an independent Python enumerator that the test suite runs against the same file, so the uniqueness claim is checked by two separate implementations.
Random boards are almost never good puzzles
Once the checker exists, the obvious question is how often a random board passes. Every valid board uses each shape exactly 5 times (two in its double, one in each of its three mixed pairs), so I shuffled the string 00000111112222233333 200,000 times and counted solutions:
| Solutions | Share of random shuffles |
|---|---|
| 0 (unsolvable) | 60.2% |
| exactly 1 | 6.2% |
| 2 | 8.5% |
| 3 or more | 25.1% |
Most shuffles cannot be solved at all. That suggests planting a solution first: pick a random domino tiling, deal the 10 shape pairs onto it, and flip each domino randomly. Every planted board is solvable by construction, but only 6.8% of 200,000 planted boards were unique. The other 93% had a second (or tenth) answer hiding in another tiling.
So "generate, then verify" is the real pipeline, and the verifier is the part that matters. At under a tenth of a millisecond per check, throwing away 14 boards to keep one costs nothing.
Shipping 365 boards as a string
The game does not generate anything in the browser. The verified pool lives in daily-boards.js as one template string, one 20-character line per board, and the build test asserts three things: 365 lines, no duplicates, and countSolutions(board) === 1 for every line. The whole module is under 8 KB.
Choosing today's board needs no server and no stored state:
function mapForDate(date) { const ordinal = Date.parse(date + 'T00:00:00Z') / 86_400_000; // 137 and 365 are coprime, so every board appears once per cycle. const index = ((ordinal * 137 % dailyBoards.length) + dailyBoards.length) % dailyBoards.length; return {cols: 5, tiles: dailyBoards[index], kinds: 4}; } Multiplying the day number by 137 instead of using it directly means neighboring days land 137 boards apart in the file, so boards that were generated next to each other (and may look alike) never show up on consecutive days. Because 137 and 365 share no factor, a full 365-day cycle still hits every board exactly once. I checked that too: 365 days in, 365 distinct indexes out.
What the player sees
Uniqueness also makes scoring simple. Par is just the number of dominoes, 10 on the daily board, and the game counts every join, release and undo as an edit. A perfect run is 10 edits with no take-backs. Since there is only one answer, two players comparing scores are always comparing the same solution.
There are two hand-made practice reefs (a 2×3 with two shapes, a 3×4 with three) before the 4×5 daily, plus a seven-day archive so a missed day can still be played.
If you want to try today's board, it is here: Reef Pairs daily domino logic puzzle on JumpBud.
