The logic behind Minesweeper’s numbers
Every number in Minesweeper tells you how many mines touch that square, counting all eight neighbours including the diagonals. That is the whole rule, and nearly everything you need to clear a board follows from reading those numbers together rather than one at a time.
The game reached a huge audience when it shipped with Windows 3.1 in 1992, and its classic Expert board, 30 squares by 16 with 99 mines, is still the standard test. Much of that board can be cleared by deduction alone. The trick is knowing a handful of patterns and knowing when none of them applies.
The two basic deductions
The first deduction is counting. If a number has exactly as many unopened neighbours as its value, every one of them is a mine. A 2 with only two closed squares beside it has a mine in both.
The second is the reverse. If a number already touches as many known mines as its value, every other closed square around it is safe. A 1 that touches a flagged mine is finished, and you can open everything else next to it.
These two rules clear a surprising amount of a board. When they run out, the next step is to compare two numbers that share some of the same closed squares.
Comparing neighbours: the 1-2
Picture a straight row of opened numbers with a row of closed squares running along one side of it, and nothing else closed nearby. Call the closed squares A, B, C, D and so on from left to right. A number in the opened row touches the closed square directly opposite it and the one on each side.
Now suppose a 1 sits opposite B and a 2 sits opposite C. The 1 sees A, B and C and has one mine among them. The 2 sees B, C and D and has two. The two numbers share B and C, and those shared squares hold at most one mine, because the 1 allows no more. So the 2 needs its second mine in the square only it can see, which is D. And because D is the 2’s extra mine, B and C hold exactly one, which means the 1’s mine is there and A is safe.
That comparison, between squares two numbers share and squares only one of them sees, is the idea behind every pattern that follows.
The 1-2-1 and the 1-2-2-1
In a 1-2-1 along a flat edge, with the numbers opposite B, C and D, the mines are under both 1s and the square under the 2 is safe. To see why, suppose C were a mine. Both 1s would then be satisfied, so B and D would be safe, and the 2 would only have one mine. That is a contradiction, so C is safe. The 2 then needs both B and D, and the 1s are satisfied, so A and E are safe too.
In a 1-2-2-1, with the numbers opposite B, C, D and E, the mines are under the two 2s and every other square along the edge is safe. Apply the 1-2 comparison from the left: the first 2 needs a mine in D, which the first 1 cannot see. Apply it from the right: the second 2 needs a mine in C. With C and D both mines, each 1 is satisfied by the mine next to it, so A, B, E and F are safe.
The two patterns look alike and give opposite answers about the squares under the 2s, so it is worth checking which one you are looking at. Both also depend on the edge being flat: if there are other closed squares touching those numbers, the numbers are shared with more squares and the reasoning no longer holds.
When you have to guess
Some positions cannot be solved by logic. The plainest is two closed squares that are touched by the same numbers and by nothing else, with one mine between them. No amount of reasoning separates them, and the only way forward is to pick one. Deciding in general whether a Minesweeper position is even consistent is a hard problem: Richard Kaye showed in 2000 that it is NP-complete.
When a guess is forced, make it early and make it count. A guess in open space far from the numbers can reveal a large area. Near the end of a game, the mine counter is worth using: if the number of mines left rules out one arrangement, that can settle a position the numbers alone cannot. In Microsoft’s versions the first click is never a mine, so the opening move is always free.
Before any guess, look again for two numbers that share closed squares. A position that seems to need luck often has a comparison in it that has not been made yet.


