Anu Gnana

Shunt

A native iPhone block sliding puzzle in the Color Block Jam and Block Out family, with one twist: the board is turn based. Drag polyomino blocks out through gates of their own colour, and every move you make advances the board one tick. 61 chapters and 3,050 levels, every one checked by a solver. No lives, no ads, no purchases. Built for one person first, the App Store second.

Version 1.2 is on the App Store as Shunt: Sliding Block Puzzle, free, for iPhone. The repo is private.

A Shunt level in play: coloured blocks on a grid, each colour's gate on the walls, and a line under the board saying what the next tick will do
A level in play, captured from the app.

The loop

Blocks are polyominoes of one to five cells in up to seven colours, and they keep their shape. One drag moves one block along any path of free cells, any distance; it cannot squeeze through a gap narrower than itself or cut a corner. A block leaves when it slides off the board through the gate of its colour, and that gate has to be wide enough for the side the block presents. A level is done when every block is out.

Journey is scored by moves against par, never by time. Par is the solver's optimum for the level: three stars at or under par, two within three over, one for any solve. Each attempt gets one undo and one hint, refilled by Restart, and the hint shows the next move of a real solution. An elapsed clock is shown alongside and can be switched off; it never affects par, stars or progress. The arcade itch goes to Rush, a timed replay of any solved Journey level: six seconds on the clock for each par move, thirty at least, with the best time kept for each level and no par or stars.

Daily is one puzzle a day, identical for everyone. Its boards are not generated on the phone: shunt-gen daily builds them ahead of time from a versioned seed, the Python rulebook replays every one, and the app ships the pool and reads the day's board from it. The first solve of the day counts, with three undos per attempt and no hints; it goes to a Game Center leaderboard by move count, where the Daily tab shows how your friends did, and the share string is two lines with no link, the score against par and then one coloured square per block in exit order. Past days stay playable, up to sixty back, but a day played late never counts towards the streak.

The tick

After every move, exits included, the board ticks once, and its living parts act in a fixed order: conveyors shift, lifts step, hoppers push out a new block, shutters open and close, then colour tiles paint. The board moves only when you do, so it can be as alive as Block Out's without a timer. A strip under the board says in words what the next tick will do and, unless you switch the warning off, says as soon as it can prove there is no way through from here.

After the basic gates and shapes, the first thirteen chapters bring in twelve more elements, one at a time: gate width, walls, arrow blocks that move on one axis, conveyors, layered blocks that peel a colour per exit, frozen blocks, lifts, hoppers, lock gates, colour tiles, shutter gates and chained blocks. The chapters after mix them.

The ink tray

The board is drawn as one object lit from one light, top and slightly left: every piece shows its thickness as a hard copy of its outline offset straight down in a darker tone, and catches the light along every edge that faces up. Nothing is blurred but the shadow of the block you are holding. Cards and tiles elsewhere in the app stand on the same lip. Glass is kept for the chrome that floats over the board; the board and the cards stay solid.

Every colour also carries a shape mark, on blocks and on gates, so the game is playable in greyscale.

The generator

Levels are not placed at random and filtered. The generator, shunt-gen, unbuilds a solved board: it draws the order the blocks will leave in, then puts them back one at a time, last first, at the edge under their gate and walked inward to a resting place, with setup moves and deliberate obstructions mixed in. Every candidate is solvable by construction, so the solver's job is to find the true par, not to reject boards.

Par comes from an A* search whose heuristic is the number of blocks still on the board. On the first chapter that took the solve from 194,000 states and fifty seconds to 634 states and a fraction of a second. Recipes ramp each chapter in bands, each denser than the last, and a level that measures badly is thrown away, never patched.

Two engines

The rules exist twice: a Python reference that is the rulebook, and the Swift engine the app plays. Every rule change lands in Python first, with a level that exercises it, then in Swift. Python replays every stored solution and re-solves every level to confirm the pars agree, and anything the two disagree on fails the pipeline. Off the solved paths too, seeded random play is written out by the Python rulebook, every legal move set and state along the way, and the Swift engine replays it step for step.

The iPhone Duo

Version 1.1, now on the App Store, adds layouts for the foldable iPhone Duo. Which layout to use is decided from the space the app is given, never from the device model. On the open inner screen the board fills the height, with the stats and controls in a side panel; a “Controls on the left” setting is there for left-handed play, and menus go to two columns when the screen is wide. A game in progress survives folding and unfolding. The work was built and checked on the iPhone Duo simulator only, with no physical device, and the test run stood at 1,175 passing when it merged.

Shunt's Daily #36 on the open inner screen of the iPhone Duo: the board of coloured blocks, with each colour's gate on the walls, fills the height on the left, and a side panel on the right shows moves, par and blocks above two control buttons
A Daily in play on the open iPhone Duo, captured from the simulator.