176 stages, none impossible — how Marble Sort is built
Marble Sort is a colour-sorting puzzle I built on my own over about a week. I teach coding in Incheon, Korea, and I make small mobile games between classes, so the target was a game I could pick up with one thumb for two minutes.
The board below is stage 34 — six colours, eight rails — cleared in 16 moves, which is the stage's par.
The rule. Glass rails stand on the screen with marbles stacked inside, colours mixed. Tap a rail to lift the top marbles, tap another rail to drop them. They only land on an empty rail or on the same colour, and a rail that ends up full of one colour locks in with a check. Two empty rails look like plenty at the start; that is the whole puzzle.
Fairness first. Each of the 176 stages is generated backwards: start from a solved board, scramble it with legal moves, then let a separate depth-first solver prove the result can still be solved. Only scrambled boards with a solution are kept. The solver's solution length becomes the stage's par, and the move budget is par plus slack (at least six moves, or 45%). So a stage cannot be impossible, and running out of moves means you took a scenic route rather than hitting a wall. Growing the puzzle. Eight chapters of 22 stages take the board from three colours and five rails to twelve colours and fifteen rails with sixty marbles. The 22nd stage of each chapter locks one rail until two colours are finished; the 11th hides a marble face down until it reaches the top. Both variants go through the same solver, locks included.
Feel. Most of the polish went into the tap: marbles arc between rails, land with a small settle, and the sound is a quiet click that can be switched off. No timers, no countdown, no flashing. Testing. A test suite runs 15,678 checks: stage structure, replaying the stored solution of all 176 stages, an independent solver replay, the engine rules, 250 random games checking that marbles are neither lost nor duplicated. Before release I also played the build with real taps in a browser — clearing stage 1, pushing through 30 and 60, deliberately breaking the move budget to test the fail-and-continue flow — and fixed what that turned up, including a name collision that left the board empty and marbles snapping back to their source texture size after a move.
What it is not. No account, no cloud, no analytics; progress stays on the device and uninstalling really deletes it. Free with a banner and an ad between stages, no in-app purchases. English by default, one tap to Korean.
Next. The last two chapters are the ones I am still tuning. If stage 100+ feels like a wall rather than a pause, that is exactly the feedback I want.
Discussion