Gooby
Blog

How I built 15 ad-free puzzle games in Rust and WebAssembly

How I built Gooby, an offline puzzle app with 15+ games and no ads or sign-up, in Rust and Dioxus compiled to WebAssembly. What was hard, what's next.

Gooby is a set of puzzle games that runs in the browser and keeps working with no connection. Today it has Sudoku, Solitaire in Draw 1 and Draw 3, 2048, Sprint (60 seconds of mental maths), Equals (cross maths), Meowdoku, Pour (water sort), Kakuro, Cagey, Domino, Atlas, Unruly, Shift, Burrow and Thread, plus a Junior mode that a parent sets up for a child. There are no ads, no in-app purchases and no sign-up. It installs from the browser on iPhone and Android, and the Android build for Google Play wraps the same web app.

I build it on my own, as a hobby, with AI writing the code.

I wanted puzzle games with no ads and no trackers, that play right in the browser, without installing a separate app for every game: one app for a whole group of puzzles. I built it mainly for kids and young people, as something that works their brain instead of flashy, eye-straining games. Nothing about it is only for kids, though; it's for any age.

This post is about how it's put together: what those three promises (no ads, no sign-up, works offline) turned into in code, the stack, how it grew, and four problems that were harder than they looked.

Sudoku in Gooby, light theme

What "no ads, no sign-up, offline" turned into

Each of the promises ended up as a piece of architecture.

No sign-up. The first time the app goes online, it makes a random user id and device id on the phone, registers them, and gets back a signed device token and a restore code. That code is the only account there is: enter it on a new phone and your finished games come back. The server looks the code up by its SHA-256 hash. The design leaves room for a real login later, as a second way into the same account, without moving any data.

Works offline. The service worker precaches the whole app on install. Puzzles don't come from a server while you play: they are generated ahead of time, graded, and shipped as small binary packs (about 90 files, under 3 MB in total) that the service worker caches like any other file. Website pages are network-first, so they are fresh when you're online and come from the cache when you're not. A new version never swaps in under you; the app says "New version — tap to refresh".

Nothing gets lost. I save a snapshot of the current game, not a log of moves. Every move is written to IndexedDB straight away, and the clock every second and whenever the app is hidden, so a reload or the phone killing the app loses nothing. Undo (50 steps) is kept with the game in progress. A finished game is frozen and becomes its history entry.

No ads. This changed the games more than the code. Water-sort games usually sell extra bottles and shuffles; Pour leaves them out, because there are no lives or ads to sell them with. Instead every board is proved solvable, so Undo and Restart are enough.

Private. There are no analytics or ad SDKs from other companies. The app counts simple events (app opened, screen shown, game started and finished) under a random id that isn't linked to the backup, sends them to Cloudflare's Workers Analytics Engine, and they are kept for at most three months. Leaderboards are opt-in. The privacy page lists exactly what leaves the device.

The stack

LayerWhat it is
Game rulesOne Rust crate per game, behind a shared Game trait
PuzzlesA packgen CLI that generates, grades and verifies packs
AppDioxus 0.7, compiled to WebAssembly; boards drawn on <canvas>
Browser glueA JavaScript shim for IndexedDB, the service worker and audio
BackendA Cloudflare Worker running the same Rust API over R2 and D1
AndroidA Trusted Web Activity built with Bubblewrap
Testscargo test plus Playwright against the real build

The Game trait is the centre of it. A game is a set of pure functions over its own types:

pub trait Game: 'static + Sized {
    const ID: &'static str;
    type Puzzle: Clone + Debug + Serialize + DeserializeOwned + 'static;
    type State: Clone + Debug + PartialEq + Serialize + DeserializeOwned + 'static;
    /// In-memory only; never persisted (snapshots are persisted instead).
    type Move: Clone + Debug + PartialEq + 'static;
    // …
    fn new_state(p: &Self::Puzzle) -> Self::State;
    /// Apply a move. `None` means the move is illegal or a no-op.
    fn apply(p: &Self::Puzzle, s: &Self::State, m: &Self::Move, o: &Self::Options) -> Option<Self::State>;
    fn is_solved(p: &Self::Puzzle, s: &Self::State) -> bool;
    // …
}

Everything around a game — undo, mistakes, hints, the timer, stars, unlocks, history, sync — is written once in the host. Adding a game means a new crate, a canvas view and a few registry lines, and it gets a daily puzzle without extra code.

I wanted Rust from the rules all the way to the buttons, and Dioxus lets me write the UI in Rust too. It can also target native apps, which I'd like to keep open; the device storage already sits behind a trait for that. I chose the stable 0.7 release over the 0.8 alpha.

One language end to end pays off on the server. When a finished game is uploaded, the Worker replays the win with the real game rules, because it compiles the same crates. On Cloudflare's free plan a request gets 10 ms of CPU; natively, that check takes about 0.2 ms per request, and the WebAssembly build is slower but stays well inside the limit.

The WebAssembly bundle is about 3.4 MB, or 1.3 MB gzipped, built with opt-level = "z", LTO, one codegen unit, panic = "abort" and wasm-opt -Oz. Because a first visit on a slow connection still takes a moment, the startup splash shows real progress: a fetch wrapper counts the downloaded bytes against the size stamped in at build time.

How it grew

From the git history of the main branch:

  • 9 Oct 2026 — first commit: Sudoku and Meowdoku in an offline-first Rust/WASM PWA.
  • 10 Oct — the API moves to a Cloudflare Worker over R2, deployed from GitHub Actions; the earlier AWS setup becomes legacy.
  • 12 Oct — landing page and guide pages for search; Atlas and Unruly.
  • 13 Oct — the app is renamed Gooby; Shift and Burrow.
  • 14 Oct — Thread.
  • 15 Oct — a motion pass over every game.
  • 16 Oct — Cagey, Kakuro, Domino and 2048.
  • 17 Oct — a startup splash, Junior mode, in-app volume.
  • 18 Oct — private usage counts, Pour, Solitaire.
  • 20–22 Oct — privacy and support pages, the Android build, store graphics.
  • 25 Oct — opt-in leaderboards; a hint now counts when it's shown, not when it's applied.
  • 31 Oct — the Daily puzzle with streaks; Sprint.
  • 1 Nov — Equals.
  • 6 Nov — Solitaire split into Draw 1 and Draw 3; Skip, with a replay of the solution, for Solitaire and Pour.
  • 23 Nov — every page retitled around "ad-free".

That's 251 commits on the main branch and 80 merged pull requests so far.

That pace is possible because Gooby is built entirely with AI: Claude Code wrote the code. My part was deciding what to build and how each game should behave, choosing between the options it laid out, trying every change on my own phones, and sending back what was wrong. Every decision is written down in the repo, which is also how I kept a project this size straight.

Four problems that were harder than they looked

1. Minesweeper with no guessing

The worst moment in Minesweeper is the forced 50/50. Burrow promises every board can be cleared by logic from the opening. The start square and its neighbours never hide a mine, and the game begins with that area dug.

The generator places mines at random, then runs the same technique solver that gives hints. Where the solver gets stuck, it moves one mine at the edge of what's known and tries again:

let f = *rng.pick(&edge);
// Swap `f` with a square of the opposite kind, preferring the unexplored
// part of the board so the known numbers change as little as possible.
let want = !mines[f];
let pool = |v: &[usize]| -> Vec<usize> { v.iter().copied().filter(|&c| c != f && mines[c] == want).collect() };
let mut other = pool(&deep);
if other.is_empty() {
    other = pool(&edge);
}

The solver also grades the board, by the hardest technique it needed. Most games here follow the same pattern: Kakuro changes digits where the solver stalls, and Equals blanks squares only while logic can still finish the board.

2. Solitaire hints that don't freeze the phone

Every Solitaire deal is proved winnable by a solver that sees every card. Within its search budget, about 77% of random Draw 1 deals and 73% of Draw 3 deals pass. The first hints were wrong, though. The quick search skips some moves, so its "this can't be won" was sometimes false (8 of 86 winnable stuck tables in an audit).

The fix was a second, full mode that tries every move that could matter, so when it says a table is dead, it is. Unit tests check that against a brute-force search on 300 random endgames. A full search can expand up to 200,000 positions, too many for one frame on a phone, so the hint button runs it 2,000 positions at a time and gives up if you move meanwhile:

let found = loop {
    if let Some(f) = search.step(HINT_SLICE) {
        break Some(f);
    }
    platform::sleep_ms(0).await;
    // A move, undo or new deal meanwhile: this hint is moot.
    if table_now(&ctl).is_none_or(|(x, _)| x != t) {
        break None;
    }
};

When nothing wins from the current table, the hint says "Off track: undo your last N moves".

3. A daily puzzle with no server

The Daily needed the same board for everyone on a date, offline, using the phone's own date. Packs only ever grow at the end, so the first 200 levels of a tier are the same on every phone. The board for a day steps through them by a stride that shares no factor with the pool size, so a tier doesn't repeat a board for as many days as the pool has levels, up to 200:

let n = (count - first + 1).min(POOL) as i64;
let h = fnv64(&format!("daily:{game}:{}", d.id()));
let mut stride = 37 + (h % 64) as i64;
while gcd(stride, n) != 1 {
    stride += 1;
}
let offset = ((h >> 32) % n as u64) as i64;
first + (stride * day.0 as i64 + offset).rem_euclid(n) as u32

Difficulty follows the weekday: Easy on Monday, Expert at the weekend. The streak, and the shields that protect it, are worked out from the daily games you've won, so there is nothing new to store or sync.

4. A 2-pixel border on an iPhone

Sudoku, Cagey and Kakuro had a frame drawn as a CSS border around the canvas. On an iPhone at 3× with the board's top at 164.25 px, the browser placed the border and the canvas on the screen's pixels separately, and the canvas covered part of the border. The fix was to stop having two things: the canvas now paints its own frame, a stroke twice the frame's width centred on its edge, so only the inner half shows.

pub fn frame(ctx: &CanvasRenderingContext2d, color: &str, w: f64, h: f64) {
    ctx.set_stroke_style_str(color);
    ctx.set_line_width(FRAME_WIDTH * 2.0);
    rounded_rect(ctx, 0.0, 0.0, w, h, FRAME_RADIUS);
    ctx.stroke();
}

A frame and the board it frames should be one drawing.

What's next

A few doors are left open on purpose: a login that joins the existing restore-code account, a native storage backend next to IndexedDB, and more guide pages for people who search for a specific puzzle.

The next step is the app stores. The Android build is ready, but a new Google Play account has to run a closed test with real testers for a couple of weeks before the app can go public. After Android, I want Gooby on the App Store too.

You can help: join the closed test by joining the goobytesters Google Group (or email goobytesters@googlegroups.com), then opt in at play.google.com/apps/testing/in.gooby.app and install Gooby from Google Play. Keep it installed and play now and then; that's what the test counts.

I'd like your feedback

Gooby is young, and I'd rather hear what's wrong with it now. If you try it, these are the things I most want to know:

  1. Which game felt confusing in the first minute?
  2. Did install and offline play work on your phone and browser?
  3. Did a hint ever send you the wrong way?
  4. What's missing that would make you come back tomorrow?

You can reach me through the support page. Or just start with today's Daily.

The code isn't public yet. If you'd like to contribute (a new game, a fix, anything), tell me through the same page and I'll open it up.

Play the games from this post

In your browser or installed on your phone: no ads, no account, and they work offline.