User Rating 0.0
Total Usage 0 times
Category Logic Games
010
000
Best Times: Beginner: -- Intermediate: -- Expert: --
Is this tool helpful?

Your feedback helps us improve.

About

Minesweeper is a single-player logic puzzle where the objective is to clear a rectangular grid of cells without detonating any hidden mines. Each revealed cell displays a number n indicating how many of its 8 orthogonal and diagonal neighbors contain mines. A cell showing 0 triggers a flood-fill cascade that reveals all connected safe cells. The game is NP-complete in the general case, meaning certain board configurations require probabilistic reasoning rather than pure deduction. Incorrect deduction on an Expert-level board (99 mines on a 30×16 grid, mine density ≈ 20.6%) leads to immediate loss. This implementation guarantees a safe first click by excluding the selected cell and its neighbors from mine placement.

The tool tracks completion times per difficulty tier using performance.now() with millisecond resolution. World-record territory for Expert is under 30 seconds. Pro tip: learn to chord (reveal all unflagged neighbors when the correct flag count surrounds a number) to dramatically reduce click count. Note: boards with density above 35% frequently produce unsolvable configurations requiring guesses.

minesweeper mine sweeper logic game puzzle game online game classic game free minesweeper

Formulas

Adjacent mine count for cell at position (r, c):

n(r, c) = (dr,dc) N8 M(r + dr, c + dc)

where M(i, j) = 1 if cell contains a mine, 0 otherwise, and N8 = {(−1,−1), (−1,0), (−1,1), (0,−1), (0,1), (1,−1), (1,0), (1,1)}.

Mine density:

ρ = mcols × rows × 100%

Flood-fill condition: cell (r, c) is added to the BFS queue if n(r, c) = 0 cell is unrevealed cell is unflagged.

Win condition: number of revealed cells = (cols × rows) m

where m = total mine count, r = row index, c = column index, ρ = mine density.

Reference Data

DifficultyColumnsRowsMinesDensityAvg. Solve TimeWorld Record
Beginner991012.3%10 - 30s0.49s
Intermediate16164015.6%40 - 120s7.03s
Expert30169920.6%120 - 600s23.42s
Custom (min)5514.0% - -
Custom (max)5050999Varies - -
Number Colors by Adjacent Count
1Blue - #0000FF
2Green - #008000
3Red - #FF0000
4Dark Blue - #000080
5Maroon - #800000
6Teal - #008080
7Black - #000000
8Gray - #808080

Frequently Asked Questions

Mines are placed only after your first click. The clicked cell and all 8 of its neighbors are excluded from the mine placement pool. This ensures your first reveal always opens a region, giving you initial information to work with. On very small or very dense boards, fewer neighbors may be excluded if the exclusion zone would leave too few cells for the requested mine count.
Chording (double-click or middle-click on a revealed number) automatically reveals all unflagged neighbors if the number of adjacent flags equals the cell's displayed number. For example, if a cell shows 2 and you have flagged exactly 2 neighbors, chording reveals the remaining neighbors instantly. This eliminates tedious individual clicks but carries risk: if a flag is misplaced, chording will detonate a mine.
Empirical analysis shows that boards above approximately 32-35% mine density frequently require guessing. The standard Expert board at 20.6% density is solvable without guessing roughly 10-15% of the time. Beginner at 12.3% is almost always solvable logically. Custom boards exceeding 40% density will require multiple forced guesses per game.
The 8 colors (blue for 1, green for 2, red for 3, dark blue for 4, maroon for 5, teal for 6, black for 7, gray for 8) are inherited from the original 1990 Windows Minesweeper. They serve a functional purpose: experienced players recognize numbers by color at a glance without reading digits, significantly reducing cognitive load and improving speed.
The timer starts on your first cell click (not on page load) and uses performance.now() for sub-millisecond precision. It stops immediately when you either reveal a mine (loss) or reveal all safe cells (win). The displayed time updates every frame via requestAnimationFrame. Best times are stored per difficulty tier in localStorage.
Yes. Arrow keys move the cursor between cells. Space bar reveals the focused cell. The F key toggles a flag. Enter performs a chord action on a revealed number. Tab cycles through UI controls. The keyboard cursor is visually indicated with a distinct outline. All game state changes are announced to screen readers via aria-live regions.