Same game, different orientation: finishing Number Match — Development · Blupoli

A screenshot could not answer the important question

Number Match reached Blupoli Puzzles on September 27, 2026 with a property we cared about more than a polished grid: every generated starting board carried a constructive route that could clear it. Issue #239 and PR #241 had defined the native game, persistence, Undo and Redo, hints, Add numbers, onboarding, statistics, achievements, localization and a long-form guide. The first delivery closed that scope and passed its verification. The next day a better question arrived than any checklist could provide: can the game actually be completed?

The doubt made sense. A screenshot can show a 9 without an obvious 1 nearby, and anyone remembering only the “make ten” half of the rules can read that 9 as stranded. Number Match has a second relationship, however: equal numbers are a valid pair too. A 9 may disappear with a 1, but it may also disappear with another 9. Explaining the rule was necessary, yet it was not enough. We needed to revisit the generator, identify what the tests genuinely proved, and separate the mathematical question from two product problems the review exposed at the same time: the four “levels” were acting as both size and difficulty, and the mobile layout was still forcing nine visible columns.

Issue #280 and PR #281 came out of that second pass. A third correction followed as Issue #282: keep 9×8 as the aspect-ratio reference, make logical width genuinely dynamic, and check the rule copy against public Number Match documentation before continuing to call the model final.

First, define what “solvable” means

The Number Match generator does not scatter digits randomly and hope useful combinations appear. It builds nested blocks. An outer pair wraps one or more inner pairs; the stored clearing sequence starts at the inside and works outward. When an inner pair disappears it leaves empty cells between the next pair of endpoints. Those endpoints were created either as equal values or as complements that add to ten. By construction, the route eventually becomes open under exactly the same rules the player uses.

Several blocks are concatenated to form the complete board. This gives us a way to change structural depth without changing the game rules and it also gives us a direct proof procedure: walk the constructive pairs in stored order, ask whether each pair is legal in the current state, clear it, and require zero active cells at the end. The revision now wraps that check in followsConstructiveSolution. It does not use privileged generator knowledge to remove cells. It calls canMatch, the same pure rule function used to decide whether a player selection is legal.

There is an important boundary around that guarantee. Proving one complete route from the starting position is not the same as proving that every arbitrary sequence of legal player choices must eventually win. Number Match can offer alternative moves, and one choice may alter later connections. Add numbers is part of the rules for positions with no available pair, while Undo exists because exploring another branch can be useful. What we can demonstrate is precise: the generator does not publish a starting board without a known complete route. A stronger claim about every reachable state would require a different proof, and we do not have that proof.

That distinction belongs in editorial copy as much as in code. “The generated board has a constructed, verified clearing route” is useful and testable. “You can never make a bad strategic choice” would be a different promise. This revision makes the first statement stronger rather than quietly drifting into the second.

A reassuring test name is not the same as broad evidence

The first release already had tests. One unit test generated a deterministic board for each difficulty and followed its constructive sequence, and one browser test did the same through the real interface. That coverage caught genuine integration problems during the original PR and showed that the mechanism worked. Once the review asked “is it actually completable?” while the variant space was about to expand, four representative cases no longer felt proportional to the question.

The new unit matrix walks all four sizes, all four difficulties and twenty seeds for every combination: 320 unique starting boards. Each case must be deterministic, contain the expected number of cells, expose at least one starting move and, most importantly, complete its entire constructive sequence through canMatch until no active number remains. Generating the same case twice must also yield the same structure. The internal selfTest samples the whole matrix again and checks that average nesting depth increases monotonically with difficulty.

We are not pretending that “many seeds” is a mathematical proof over every possible integer seed. The constructive method provides the underlying guarantee; the matrix attacks implementation mistakes in parameterization, block offsets and combinations that a single example might never exercise. Those are two different kinds of evidence and they reinforce each other: reasoning about the construction and repeatable execution over a broader surface.

A Playwright solve test remains important as well. It opens the real page, clicks the constructive pairs through the DOM and waits for the shared completion state. That covers a bridge the pure core cannot: generator indices must arrive at the right buttons, the UI must clear the same cells, and solved() must fire when the active count reaches zero.

The old “four difficulties” were hiding two dimensions

The first delivery coupled size and difficulty. The next pass separated them but still kept nine columns fixed, varying only height through 9×4, 9×6, 9×8 and 9×10. That solved the 4×4 progress domain but produced noticeably different board proportions.

The current correction uses 7×6, 9×8, 11×10 and 14×12. The 9×8 board is the reference and the other three stay close to its aspect ratio. Logical width now belongs to the selected size instead of being a global constant.

Difficulty remains independent and controls constructive depth. We still have sixteen combinations: four geometries by four difficulty levels.

Achievement integration became a real domain instead of a checkbox

Number Match already had three special achievements in content/achievement-specials.json. “No expansion” is signalled when a game finishes without Add numbers, “At a glance” when it finishes without hints, and “No turning back” when Undo and Redo were never used. The engine already emitted those three signals at completion, so that part of the first integration was genuine and did not need replacing.

The generic mastery domain did change. The shared achievement engine inspects the variants declared by a game. When it sees several sizes and several difficulties, it builds the product of those dimensions to know which combinations exist. Before this revision Number Match declared only difficulty, so its domain contained four cells. It now contains sixteen. The Number Match test asserts domainDefinition(game).cells.length === 16 so a future metadata edit cannot silently collapse that surface again.

This feeds generic Explorer, Challenge and Domain-style progression without adding Number Match-specific branches to the achievement engine. That is the kind of integration we want from a platform: the game describes its surface correctly and shared systems derive behaviour from the contract. The less conditional code we need with a puzzle name embedded in it, the more confidence we have that the abstraction is doing useful work.

Statistics needed both dimensions to travel with the session

The shared session receives size and difficulty separately. Size is no longer a 9×N convention: it carries the complete selected geometry, with actual columns and rows in metadata.

Puzzle identity includes size, difficulty and seed, so a 7×6 Easy game and a 14×12 Easy game cannot accidentally share the same record bucket or identity.

Shared statistics and achievement systems consume those dimensions without Number Match-specific branches.

The first responsive solution preserved logic but not the best shape

The first PR kept nine visible columns at every width. The second introduced visual transposition. The third removes the assumption that every board has nine logical columns: each size keeps its real width.

The responsive principle remains the same. Phones should use the long axis vertically and desktops horizontally, without regenerating values or reinterpreting indices. We rotate presentation, not state.

Rotate the view, not the game state

canMatch now receives the puzzle's logical width. Rows, columns, diagonals and the next-row wrap are calculated from that dynamic value. Persistence and history still store the same cells array.

Rendering exposes current columns and rows as CSS properties. When a logical board is wide and the viewport is narrow, rows become visible columns and columns become visible rows while digits remain upright.

A 7×6 board therefore presents as 6×7 on a phone, while 14×12 presents as 12×14; logical geometry and move rules stay unchanged.

Saved-game compatibility is part of “the same board” too

The proportional correction changes actual topology. Automatically reshaping a 9×4 or 9×10 saved game into 7×6 or 11×10 would change rows, diagonals and legal pairs.

Number Match therefore moves its internal state to version 2 and stores sizeId. Snapshots from the intermediate geometry are not forced onto the new model; a clean reset is more truthful than compatibility that changes a saved game's rules.

Responsive behaviour needed an identity test, not only geometry assertions

The E2E opens 7×6 on desktop, captures every cell, then shrinks the viewport to 390×844. The array must remain identical while the visible grid becomes six columns by seven rows.

Another case opens 14×12 on desktop and requires fourteen columns, twelve rows and a longer horizontal axis. The resume test also confirms that size and history survive a reload.

These checks separate game identity from visual geometry: regenerating on viewport change would fail the cell comparison even if the resulting board looked plausible.

Blog and Devlog are different editorial integrations

The audit found that Number Match already had a substantial Blog guide in Spanish and English, with cover art, an infographic, SEO metadata and internal links. It also found no dedicated Number Match Devlog entry. We did not solve that by copying the guide and changing its heading. The Blog teaches the player how to read equal pairs, complements, gaps and future openings. This article exists because the technical story is different: a solvability guarantee with precise limits, a size/difficulty coupling, a responsive requirement that cannot alter topology, and platform integrations that should be demonstrated rather than assumed.

The Blog guide is updated so it no longer preserves false documentation. It no longer says Easy means four rows or that a phone must display nine columns across the screen. It explains the four independent sizes, four difficulties, and the idea that the selected logical dimensions remain true even when the visual representation turns. The guide links here for readers interested in engineering; this Devlog links back to the Number Match guide so strategy and implementation do not compete for the same paragraph.

This story also connects naturally to Generating is not solving, because we are again separating a property we can prove from an output that merely looks plausible, and to Progress starts when you play, because size and difficulty only matter if they reach the shared session contract correctly.

What is actually integrated after this pass

An inventory is more useful than saying “everything is wired up.” Number Match runs inside the native game host and its shared session lifecycle. It saves snapshots and restores history. It publishes moves, hints, size, difficulty, puzzle identity and board metadata. Completion goes through solved(), feeding the common game result. The catalogue declares four sizes and four difficulties so progress and achievements understand the domain. Three measurable special signals remain connected. Onboarding and game copy exist across the six supported locales. The player-facing Blog guide exists in Spanish and English and now describes current behaviour. The missing technical Devlog is this entry.

The inventory also makes limitations visible. The constructive route proves the generated starting board has at least one complete clearing path. We have not added an exhaustive solver that certifies every continuation after every possible human decision. Add numbers remains a game rule, not a universal proof that an arbitrary state must recover after a finite number of presses. If we ever want to make that stronger claim, it should become a separate feature with a separate proof.

Being explicit about boundaries creates more confidence than attaching “guaranteed” to an undefined concept. We now know what the generator guarantees, where that property is checked, how a variant is represented, which shared systems consume those dimensions, and which transformation belongs only to presentation.

The broader lesson: responsive geometry and solvability belong to different layers

This revision ended up touching generation, UI, persistence, statistics, achievements, tests and editorial content. The architecture stayed understandable because those layers kept distinct responsibilities. The core decides which pairs exist and whether a route is legal. The engine stores the game and publishes dimensions. CSS decides how to orient the same geometry for the device. Progress consumes dimensions without knowing Number Match internals. Blog and Devlog tell different stories to different readers.

The tempting response to a visual complaint would have been changing the mobile column count. The tempting response to a solvability question would have been adding reassuring copy. Neither addresses the right layer. A board can be mathematically solvable while its size model is incomplete and its mobile presentation is awkward. Separating those questions let us fix each one without weakening the others.

That leaves Number Match in a more useful position for future work. Size density can be tuned without redefining difficulty. Difficulty can be calibrated without changing physical dimensions. Layout can evolve without migrating logical boards. Achievements can measure 4×4 coverage through the common engine. And when someone asks again whether a generated board starts with a solution, the answer no longer depends on reassurance: the generator retains the route and the tests walk it.

Return to the board with a better question

After all this engineering, the player's gesture is unchanged: look at two numbers and decide whether they can disappear. That is a good result. The additional complexity lives behind selectors, storage and presentation instead of sitting on top of the core rule.

If you see a 9 without a 1, look for another 9. If no pair is obvious, remember that equality and making ten are only the first layer; the path matters too. And when the board looks tall on a phone and wide on a desktop, you are not looking at two generated puzzles. You are looking at the same sequence, seed and history presented in the orientation that uses each screen more effectively.

You can try the result in Number Match on Blupoli Puzzles. For player strategy, the full guide goes deeper into pairs, gaps, row-order scanning and planning. This Devlog remains the record of the other half: what we had to prove and separate before “the same board” really meant the same board.

Number Match diagram separating logical topology, responsive presentation, sizes, difficulties and automated checks
The revision separates four responsibilities: rules, orientation, variants and repeatable evidence.