August 14, 2026
Minesweeper: the logic behind flagging without guessing
Minesweeper looks like a guessing game to a new player, but most boards can be cleared almost entirely through deduction. The numbers aren’t hints, they’re a complete count: a revealed cell showing “3” means exactly 3 of its up-to-8 surrounding cells are mines, no more and no less. Two simple rules, applied over and over, are enough to resolve most of the board without ever taking a real risk.
Rule 1: if the number matches the unopened neighbors, they’re all mines
If a revealed cell’s number is equal to the number of neighboring cells that are still unopened, every one of those unopened neighbors must be a mine. There’s no other way for the count to come out right.
2 5
# #Say the “2” above sits in the top-left corner of the board, so it only has 3 neighbors total: the “5” to its right, and the two unopened cells below it. One neighbor is already revealed (safe), leaving exactly 2 unopened neighbors, and the cell’s number is 2. Both unopened cells must be mines. Flag them both.
Rule 2: if the number matches the flags, everything else nearby is safe
The mirror image of rule 1: if a revealed cell’s number is equal to the number of neighboring cells already flagged as mines, then every other unopened neighbor of that cell is guaranteed safe, since the cell’s full mine count has already been accounted for.
1 5
F #Here the “1” is again a corner cell with 3 neighbors: the “5” (already revealed), a flagged mine below it, and one more unopened cell. One neighboring mine has already been found, matching the cell’s number exactly, so the remaining unopened neighbor can’t also be a mine. It’s safe to open.
Chaining the two rules across the board
Neither rule looks at more than one numbered cell at a time, but their effects compound. Flagging a mine with rule 1 can immediately satisfy rule 2 for a different numbered cell elsewhere on the board, one that shares that same mine as a neighbor, which opens more cells. Opening those cells reveals new numbers, which can trigger rule 1 again nearby. Working a board well means repeatedly scanning every revealed number for either condition, flag-then-check, open-then-check, until neither rule finds anything new rather than trying to solve the whole board in one pass.
In practice this means checking each revealed number against its unopened and flagged neighbor counts, and revisiting numbers you’ve already looked at whenever a neighboring cell changes state. A number that couldn’t be resolved a moment ago often becomes solvable once a nearby flag or reveal changes its neighbor counts.
When guessing really is unavoidable
Occasionally neither rule applies anywhere on the board, and the remaining unopened region genuinely has more than one arrangement of mines that’s equally consistent with every visible number. The classic case is two unopened cells next to a single “1,” where either cell could be the mine and both possibilities satisfy every constraint on the board. No amount of logic distinguishes between them, since the information genuinely isn’t there yet. In that situation the two rules above have done everything they can, and the remaining choice is a real 50/50 (or worse), not a failure to spot something. Recognizing that a position is a genuine guess, rather than a deduction you’ve missed, is itself part of getting good at the game.
Want to try it yourself?
Play Minesweeper →