UYLLII

Blog › Engineering

Engineering

No-guess Minesweeper: generating boards you can always solve by logic

By David3 min read
Minesweeper feature graphic

Minesweeper has a dirty secret every keen player knows: sometimes you have to guess. You've played perfectly, the numbers say nothing more, and two squares are left with a 50/50 between them. You click, you lose, and it wasn't your fault.

No-guess Minesweeper removes that. Every board can be solved from the first dig by logic alone. Keen players search for it by name, and it's the headline feature of Minesweeper Classic - No Guess.

Why Minesweeper

In the search research, "minesweeper" looked unusually open. The top ten had a median of about 1.7 million installs, yet three apps from this year with under 1,100 installs sat in that top ten. Classic Windows games skew older and Western, which is this portfolio's audience. And "no guess" is a keyword of its own.

It's also the kind of game that's cheap to keep on the shelf once built. It was forked from the Spider Solitaire codebase and built in about three hours.

The board sizes

Tap to dig, long-press to flag, drag to pan, pinch to zoom. The squares are large on purpose.

The first dig is always safe

Mines aren't placed until your first tap, and never on or next to the square you dug. So the first dig always opens an area instead of a single number, which gives the logic something to work with.

How no-guess generation works

The method is brute force guided by a solver:

  1. Place mines randomly, avoiding the first-dig area.
  2. Hand the board to a logic solver that plays it like a careful human, starting from the first dig.
  3. If the solver clears the whole board without ever guessing, keep it. If it gets stuck, throw the board away and draw another.

The solver knows the standard deductions:

About 15% of random Expert boards pass from a given opening, so it takes roughly seven tries. That's under 10 ms on a desktop. I still want to measure it on a cheap phone and move it to a Web Worker if it ever goes over 100 ms.

The same solver powers the hint button. A hint isn't "this square is safe because we know where the mines are", it's "this square is safe, and here is why". The test suite checks every solver proof against the real mine positions over 530 games, plus 30 UI flow checks.

The daily board

There's a daily Intermediate board, no-guess, the same for everyone, with a streak, plus stats per difficulty. It's the same seeded-content trick as the Word Search daily.

Monetisation: the second chance

Most of the engine's ad setup carries over: a banner, interstitials at breaks, rewarded videos for hints. Minesweeper adds one placement I think is the strongest this genre has: a second chance after you dig a mine. Watch a video (or spend coins) and carry on.

It works because of when it's offered. You're forty minutes into an Expert board and one slip away from losing all of it. That's the moment a rewarded video is a genuinely welcome offer rather than a toll. Few of the top apps have it.

A family tree

This game ended up with a child. The no-guess solver became the core of Minesweeper Rogue, a roguelike where each level adds rules that change what the numbers mean: liar numbers, wraparound edges, knight's-move neighbours. Every one of those rules had to be taught to the solver, or the no-guess promise would break. That's a later post.

Minesweeper screenshot 1Minesweeper screenshot 2Minesweeper screenshot 3
Minesweeper on Android.

How it's doing: it ranks around 9th or 10th for "minesweeper no guess" and in the teens for "minesweeper classic", but not in the top thirty for plain "minesweeper". Long-tail phrases first, head terms later, if ever. It's earned a few cents. It costs nothing to keep on the shelf.