Behind the scenes · about 8 minutes

How no-guess boards are made

Anyone who has played minesweeper knows the moment when "it's luck from here." You stare at the numbers, and there's no way to tell which of two cells is the mine. Exit Mine makes sure that moment never comes: before a board goes out, the computer solves it itself, and only boards that pass are served. This article walks through how one board is made, step by step.

1. Why regular minesweeper needs guesses

Regular minesweeper scatters mines at random, and random mines sometimes form shapes the numbers can't tell apart. The most common is a pair of cells against a wall with a mine in only one of them, where every number touching them just says "1." The visible numbers are the same whichever cell holds the mine, so logic can never decide.

These shapes show up more as the board gets denser. In fact, if you generate random boards at the density of Exit Mine's stage 20 (25%), only about one in forty can be solved all the way by logic (see minesweeper by the numbers). Served at random, late stages would almost always need luck.

2. Step 1: placing mines

A board places its mines in this order:

  1. Reserve the cells that stay empty. The entrance (bottom-left corner), the three cells touching it, and the exit (top-right corner) never get a mine. That's why the entrance always shows 0, and why the game can blink the cells around it yellow to say "these are safe, start here."
  2. Pick mine spots at random from the rest. Like shuffling a deck, the candidate cells are shuffled and the needed number are taken from the front. It's a long-established shuffle that gives every cell the same chance.
  3. Work out the numbers. For each cell, count the mines among its 8 neighbors.

3. Step 2: throwing out boards that are too easy

A game starts with the entrance, its neighbors, and the exit already open. If those starting cells alone already connected the entrance to the exit, there'd be nothing to do, so such a board is discarded. On real board sizes this practically never happens, but the rule is there anyway.

4. Step 3: the solver plays it

Here's the heart of it. A computer solver plays the board using exactly the information a player has. The solver knows where the mines are, but when it reasons it only uses the numbers on opened cells and the rule that the entrance and exit have no mines. It uses just two kinds of reasoning:

The solver finds every cell these two rules can settle, opens all the safe ones to get new numbers, and applies the rules again. It stops when nothing new can be settled, then checks whether the cells it opened link the entrance to the exit up, down, left, or right. If they do, the board passes; if not, it's thrown away and the process starts again from step 1.

What the two rules mean in practice is explained with diagrams in the pattern guide and advanced techniques. Named patterns like 1-1, 1-2, and 1-2-1 are all special cases of these two rules.

5. If the solver can, so can you

The solver opens every certain cell, while a Classic player opens only some to save cells. How can we be sure the player never gets stuck?

Opening more cells only adds information; it never overturns a conclusion. A cell that's certain now stays certain later. If the solver reached the exit, a player opening certain cells in the same order can always get there too. If saving cells left you short on information, open one of the certain cells you skipped to get more. As long as a certain cell remains, you never need to guess.

Put the other way around: if it feels like you have to guess in Exit Mine, there's a certain cell somewhere you haven't found yet. Widen your view to numbers a little away from your path.

6. The safety net: one mine fewer

On big boards with strict conditions it can take many attempts to get a passing board. If no passing board turns up within a fixed number of tries (400), the generator removes one mine and searches again. Fewer mines make boards easier, so a passing board is guaranteed eventually. In practice even stage 20 finds a passing board in about 40 tries on average, so the safety net essentially never kicks in. You can take the mine counts in the stage table as the real counts.

7. Same seed, same board

"Random" in Exit Mine really means a sequence produced in a fixed way from a starting number called a seed. Feed in the same seed and you get the same board, wherever and whenever it's made. That makes two things possible:

That also means changing how boards are generated would produce different boards from the same seeds, and old records could no longer be verified. So Exit Mine stores a generator version number with every record, and the server rebuilds the board with the same version when it checks.

8. What hints do

The three hints per game tell you whether a chosen cell is a mine or safe. A safe cell simply opens; a mine is marked without ending the game. Boards are built to be solvable without hints, so a hint isn't a necessity — it's a way to save time when you've missed a certain cell. That's why using hints doesn't hurt your record.

Play a verified board →