Blog

Counting and Subtraction in Minesweeper

Every number on a Minesweeper board is a tiny equation: it tells you exactly how many mines hide among its covered neighbours. The single most powerful habit in the game is comparing two numbers whose neighbours overlap — because subtracting one from the other often pins down a cell that neither could solve alone.

This is the engine behind most "how did they know that?" moments. It needs no guessing and no memorised shapes — just careful counting.

The basic count

Start with the rule that does the most work: if a number equals the count of its still-covered neighbours, every one of them is a mine — flag them all. And the mirror: if a number already touches enough flagged mines to meet its value, all its other covered neighbours are safe — click them freely. Clear those two situations first on every move; they cost nothing.

Subtraction: the 1-2 reduction

The interesting cases appear when two numbers share some covered cells but not all. Look at a 1 sitting beside a 2, both touching the same two covered cells, with the 2 reaching one extra cell the 1 can't see.

A revealed 1 next to a revealed 2 sharing two covered cells; subtracting the constraints forces the extra cell to be a mine12
The 1 and the 2 share the left two covered cells. The 1 says those two hold exactly one mine. The 2 needs two mines in total — so the extra cell only it touches must be the second mine.

The shared cells hold exactly one mine (the 1 says so). The 2 needs two mines among the shared cells plus its extra cell. One is already accounted for in the shared pair, so the leftover mine has nowhere to go but the extra cell. That cell is a mine — guaranteed, even though you still don't know which of the shared two is dangerous.

Subtraction: the 1-1 reduction

The same overlap trick finds safe cells too. Put a 1 next to another 1, where the second one reaches an extra covered cell.

A revealed 1 next to another revealed 1 sharing two covered cells; the extra cell of the second 1 must be safe11
Both 1s allow only a single mine. They already share two covered cells that must contain that one mine — so the extra cell the right 1 touches has to be empty. It's safe to click.

Both numbers permit exactly one mine. They share two covered cells, and those two already have to contain the single mine the left 1 allows. The right 1 is therefore satisfied by the shared pair alone, so its extra cell must be safe. Click it without fear.

How to practise it

When you stall, don't stare at one number — find a pair of adjacent numbers and ask what cells they share and what cells they don't. The shared part cancels; the leftover almost always resolves to a mine or a safe square. Once subtraction stops producing certainties, you've reached the point where probability takes over. Until then, you should never be guessing.

Play Minesweeper — three board sizes