Minesweeper

010
000
Best
Desktop: left-click to open · right-click to flag · click a number (or middle-click) to chord. Mobile: tap to open · long-press to flag.

Minesweeper Rules, Controls, and First Deductions

Goal and numbers. Open every cell that does not contain a mine. Opening a mine ends the game. An opened number is the exact count of mines in the cells touching it horizontally, vertically, or diagonally: up to eight neighbours in the middle of the board and fewer at an edge or corner. A blank cell is a zero, so none of its in-board neighbours is a mine. You win as soon as every non-mine cell is open. Flags are working notes, not a separate win requirement; any unflagged mines are flagged automatically at the finish.

The first open. For the first cell you open, this implementation removes that cell and all of its in-board neighbours — at most eight — from the mine candidates. The first cell is therefore always a zero and opens a blank region. This protection describes the opening move; it does not change what later numbers mean.

Desktop controls. With Flag mode off, left-click a covered cell to open it; left-click an opened positive number to attempt chording. Right-click a covered cell to toggle a flag. With Flag mode on, an ordinary left-click toggles a flag on a covered cell and does nothing on an opened cell. Middle-click can still attempt chording on an opened positive number in either mode. Chording works only while a game is in progress and only when the number of adjacent flags exactly equals the opened number. It then opens every adjacent covered cell without a flag. If the flag count is right but a flag is on the wrong cell, the game finds an unflagged mine first and ends before opening any safe neighbours from that chord.

Touch and pen controls. With Flag mode off, tap a covered cell to open it or an opened positive number to attempt chording. Press and hold a covered cell for 450 ms to toggle a flag. With Flag mode on, an ordinary tap toggles a flag on a covered cell and does nothing on an opened cell, so switch it off before using a tap to chord. Flag mode switches off when a new game starts.

Two basic deductions. For an opened clue n, subtract the k adjacent mines already established by logic. The result r = n − k is the remaining mine count. Let u be the number of adjacent covered cells not yet established as mines. A valid state must satisfy 0 ≤ r ≤ u; a result outside that range means an earlier assumption or mark conflicts with the clue. If r = 0, all u cells are safe. If r = u, all of them are mines. A flag belongs in this calculation only when its position has been proved.

Subtraction and the conditional 1–1 pattern. After deducting established mines, compare two clues whose unresolved-neighbour sets are A and B, with remaining mine counts a and b. If A ⊆ B, subtract the subset equation from the superset equation: the cells in B − A contain exactly b − a mines. The 1–1 case uses this containment with a = b = 1, so every cell in B − A is safe. Two adjacent 1s without that neighbour-set relationship do not establish the pattern.

The conditional 1–2–1 pattern. This pattern applies along a straight revealed boundary only after known mines have been deducted and the three effective clues are 1, 2, 1. Their unresolved neighbourhoods must reduce to three aligned covered cells: the left clue sees the left and middle cells, the centre clue sees all three, and the right clue sees the middle and right cells. Under those conditions the two outer cells are mines and the middle cell is safe; a rotation or reflection is equivalent. If any clue sees another unresolved cell, do not decide from the three-cell diagram alone. Rebuild the full neighbour-set equations and compare them instead. Chording can then carry out a deduction around a number whose correct flags already match it, but chording is not a substitute for proving those flags.

Difficulty presets

LevelStandard boardMinesDensityNarrow portraitPortrait density
Beginner9 × 91012.35%
Intermediate16 × 164015.63%13 × 20 · 40 mines15.38%
Expert30 × 169920.63%13 × 37 · 99 mines20.58%

When a new Intermediate or Expert game starts, the site checks the available play width and pointer precision. If the standard board would be too cramped for that input, it uses the narrow portrait shape. Resizing the window does not change the rows or columns of a game already in progress. Beginner has no separate portrait shape.

A documented Windows release. Microsoft's official 1990 chronology records the October 8, 1990 announcement of the Microsoft Entertainment Pack for Windows and lists MineSweeper among its games.

Minesweeper FAQ

Do I have to flag every mine to win?
You win when every non-mine cell is open. The game then flags any remaining mines automatically.
Is the first cell I open always safe?
The first opened cell and all of its in-board neighbours are excluded from mine placement, so the first cell is a zero and opens a blank area.
Does first-open protection mean every board has a forced solution?
First-open protection covers only the first cell and its neighbours. Check all number constraints and subset deductions; if the visible constraints still do not distinguish between covered choices, the opening guarantee does not choose one for you.
When does chording work, and why can it hit a mine?
Chording works on an opened positive number only when its adjacent flag count exactly matches the number. It trusts the flag positions. If the count matches but a flag is misplaced, an unflagged real mine ends the game.
What does Flag mode change?
While it is on, an ordinary click or tap toggles a flag on a covered cell and does nothing on an opened cell. A desktop middle-click can still chord. A new game switches Flag mode off. Desktop right-click and a 450 ms touch or pen hold also toggle flags on covered cells.
Why can the mine counter be negative?
The counter is the preset mine total minus the number of flags you have placed. It can go below zero because the interface does not stop you from placing more flags than there are mines.
When does the timer start and what can it display?
It starts after the first open. The on-screen timer displays values from 000 through 999 seconds.
What is saved in the browser?
The current board and the best time for each difficulty are saved.