Hexsmith
A nut-sort puzzle game for iPhone and Android with 300 solver-checked levels

Overview
Hexsmith is my own sort-puzzle game: lift the run of same-coloured nuts off the top of a bolt and screw it onto another, until every bolt holds a single colour. It is easy to learn and the kind of thing you finish one more level of before putting the phone down.
The game is free and fully offline, with no ads, no account and no data collection, in English and Turkish. It is live on the App Store for iPhone and iPad, and the Android version is being prepared for Google Play. The workshop theme runs through everything: brass gauges and gears around the board, an “inspected” stamp when a level is solved, and a workshop that you restore between levels.
What’s in the game
- 300 levels, all solvable. Every level is checked by a solver before it ships, so there is always a way out. The difficulty rises gently, with breather levels between the hard ones.
- Eleven mechanics, introduced one at a time with a short card: hidden nuts that show their colour once they reach the top, bolts of different sizes, frozen bolts, locks and keys, chains, bomb nuts that count down, big nuts that take two spaces, capped bolts, chameleon nuts, one-way bolts and tied bolts.
- Help when you need it. Undo your moves, ask for a hint, add an extra bolt or shuffle the loose nuts. Finishing levels earns coins and stars, with daily rewards and a streak.
- A puzzle of the day. The daily level is generated on the device from the date, so every player gets the same board without a server. It gets harder through the week, from five colours on Monday to eight on Sunday.
- The workshop. Stars restore parts of a workshop, piece by piece, and a finished location opens the next one. The locations are data, drawn as inline SVG, so new ones can ship without an app update.
- 32 achievements in the game’s engine-room vocabulary, each with a small coin reward.
How it was made
- Rules as a package. The game rules live in an engine-agnostic TypeScript package with a plugin system for mechanics: a new mechanic is a module with a few hooks, and the core rules never change. The client only renders the events the rules emit.
- A level pipeline instead of hand-made levels. A reverse-scramble generator starts from the solved board, so every candidate is solvable by construction. A breadth-first solver with canonical-state deduplication gives the exact minimum moves, a difficulty model with bot players scores each candidate, and a curve-driven curation step picks one level per slot of the difficulty curve. Verification rejects stale solutions, duplicates and unsolvable levels before a commit.
- A level editor in the browser. Paint bolts and nuts, play the level, step through the optimal solution, review generated candidates and reorder the progression by drag and drop against the difficulty curve.
- One codebase, several apps. The game, the level editor, the playable ad (one HTML file per ad network) and the command-line tools share the same packages in a pnpm monorepo. An economy simulator shows what a change to rewards does to coin flow over a month.
- Rendering and shell. PixiJS 8 draws the board, with pooled sprites and shared textures to keep low-end Android phones smooth. Capacitor 8 wraps it for iOS and Android; the app icon and splash screen are drawn as SVG and generated for both platforms.
- Local first. The save lives on the device and is signed against casual edits. Store builds make no network requests, which is why the App Store privacy label is “Data Not Collected”.
Technologies
- TypeScript, PixiJS 8, Vite, Capacitor 8, Zod
- pnpm workspace with Vitest and fast-check property tests, ESLint, Prettier
- Node.js command-line tools for generating, analysing, curating, verifying and packing levels
Quality
- About 260 unit and property tests across the rules, solver, generator, difficulty model and economy, and a level verification that runs before every push
- Scripted touch playthroughs of whole level ranges, and a performance budget measured on a low-end Android device
