Skip to content
UniKit

Minesweeper

Play real minesweeper in the browser: left click reveals, right click flags, the first cell and its eight neighbours are always safe, and a flag mode toggle is included. The field is seed-generated and reproducible, and mines left, derivable cells and the timer all come from the real board.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Revealed 0 / 71 safe cells

Minefield

Left click reveals, right click flags (or press F for flag mode). The first cell you open and its eight neighbours are guaranteed to be mine-free.

Not started: open any cell first (it and its eight neighbours are safe).
Revealed
0 / 71
Mines left
10
Flags
0
Derivable cells
0
Time
0:00
Hints used
0

Keyboard: F toggles flag mode, N starts a new game (click the board first so keystrokes land there).

What this tool does

  • Play minesweeper right away: 6x6, 9x9 and 12x12 difficulties, left click to reveal, right click (or F for flag mode) to flag, with a clear ending on a mine or a cleared field.
  • Race a friend on the very same field: the first cell you open decides the layout, so the same seed plus difficulty and first click is fully reproducible.
  • Practise basic reasoning: the status line reports how many cells are derivable in one pass, and Hint points at one of them.
  • Review as you go: Undo returns to the previous position, and both the timer and the flag count come from your real moves.

Example

Input

seed demo · 9x9 · 10 mines · first click on row 1, column 1

Output

Row 1, column 1 has neighbour count 0 → 43 safe cells open at once (43 / 71 revealed)
Mines left 10 (nothing flagged yet) · 5 derivable cells (all of them certain mines)
Clicking row 2, column 5 next hits a mine: the round ends and every mine is shown

These numbers come from the real field for seed demo, 9x9, 10 mines and first click index 0 (buildMinesweeper + revealMinesweeper); another seed or first click gives another field.

Frequently asked questions

Can the first click hit a mine?

No. The field is generated on the first reveal and excludes that cell plus its eight neighbours, so the first click always has neighbour count 0 and floods the surrounding safe area. Flagging does not generate the field - only revealing does.

Is the field reproducible?

Yes. Mines are picked by an xorshift128 shuffle over all cells driven by the seed, so the same seed, difficulty and first click always give the same field. The seed is shown in the controls.

How are “mines left” and “derivable cells” computed?

Mines left is mines minus flags (a real count, never a guess). Derivable cells come from one pass over the revealed numbers: cells whose remaining neighbours must all be safe, plus cells whose remaining neighbours must all be mines. When nothing can be derived the hint says so instead of pretending to know.

Can I see the mines after losing?

Yes. When the round ends every unflagged mine is marked with ✳ and the mine you hit is highlighted, so the position can be reviewed. Press “New game” or N to start again.

Are there a timer and undo?

Yes. The clock starts on the first real reveal, runs on performance.now() and stops when the round ends. Undo returns to the previous position using real snapshots of the board. Everything runs in the browser and nothing is uploaded.

How do I play with the keyboard?

Click the board first so keystrokes land there, then press F to toggle flag mode (left click then places a flag) and N to start a new game. Right click always flags or unflags without switching modes.

Keywords:minesweeper

Related tools