gekro
GitHub LinkedIn

Mines

Play a free mine-clearing puzzle on three board sizes. The first click is always safe, and flags and chording work with mouse, touch or keyboard.

Mines left 10

Time 0:00

Best -

Click or press Enter to open a cell. Right-click, long-press, the F key or Flag mode puts a flag on a suspected mine. Clicking a number whose flags match it, or pressing C, double-clicking or middle-clicking, opens the cells around it. Arrow keys move, Home and End jump to the row ends. The first click is always safe.

How the board is made

Nothing is placed until your first click. Then the mines are drawn from every cell except the one you clicked and its neighbours, so the first click always lands on a zero and opens a region. Opening a zero opens all its neighbours with an explicit stack instead of recursion, so the biggest board cannot overflow the call stack. Boards are not checked for being solvable without guessing, so some games need a guess.

As-is, no warranty. These apps are free under their listed license and run entirely in your browser. Use at your own risk — don't blame me if your PC catches fire, your dog runs away, or the math turns out wrong. Verify anything that actually matters. None of this is professional financial, medical, legal, or engineering advice.

© 2026 Rohit Burani · MIT · Built at gekro.com · View source ↗

Guide

How to play

Open every cell that does not hold a mine. A number tells you how many of the eight cells around it are mines. An empty cell has none, so opening one opens everything around it, and that spreads until it reaches numbers.

  • Open a cell: click, tap, or press Enter or Space on the focused cell.
  • Flag a suspected mine: right-click, long-press for half a second on touch, press F, or turn on Flag mode and tap. Flag mode is there for phones, where a long-press is awkward.
  • Chord: on an open number whose flags already match it, click or tap it, double-click, middle-click, or press C, and the rest of its neighbours open at once. If one of your flags was wrong, that opens a mine and the game ends.
  • Move around: arrow keys move between cells, Home and End jump to the ends of the row.

The Mines left counter is the number of mines minus the number of flags, so it goes negative if you place too many flags. The timer starts at your first click and stops when you win or lose. When you win, the mines you had not flagged are flagged for you. When you lose, every mine is shown and each flag on a safe cell is marked with a cross.

Closed tiles are rounded and tinted, and each number has its own hue plus the digit itself: 1 sky, 2 green, 3 rose, 4 violet, 5 orange, 6 teal, 7 amber, 8 lime. A flag is a small pennant on a pole, a mine is a spiky ball, and a flag on a safe cell shows a cross, all drawn with shapes, so the board does not depend on telling colours apart. The three counters (mines left, time, best) are plain rounded chips. A win lights the result box with a soft glow, which is switched off if your device asks for reduced motion.

Levels

LevelSizeMines
Beginner9 x 910
Intermediate16 x 1640
Expert30 columns x 16 rows99

The Expert board is 480 cells, wider than a phone screen. On a phone, Intermediate and Expert keep every cell at least 28 px wide, so those two boards scroll sideways inside their own box rather than widening the page or shrinking the cells.

How it works

The first click is always safe. Nothing is on the board until you click. At that moment the mines are drawn from every cell except the one you clicked and the cells touching it, so your first click always lands on a zero and opens a region. The draw is a partial shuffle, and the tests confirm that every allowed cell can end up holding a mine. They also check the rules on every first-click position of the Beginner and Intermediate boards, and on a spread of Expert positions including all four corners: exactly the right number of mines, never on the clicked cell, never next to it.

The flood fill has no recursion. Opening a zero uses an explicit stack. A recursive version can overflow the call stack on a large empty area, so the tests open a 400 x 400 board with no mines, 160 000 cells, in one click. The flood fill is also compared against a plain recursive reference on about two hundred random boards, with and without flags in the way, and the two always open exactly the same cells. Flagged cells are never opened by a flood.

Chording follows one rule. The number of flags around an open number must equal the number. Fewer or more does nothing. When it matches, every unflagged neighbour is opened, and a wrong flag means a mine among them.

Only changed cells are redrawn. Each move returns the list of cells whose appearance changed, and the page repaints just those. A click on the 480-cell board does not rebuild the board.

The engine is plain functions. Placement, counts, reveal, flag, chord and win and loss detection take the randomness as an argument, so with a seeded generator the same clicks give the same game. The page itself uses the browser’s cryptographic random source.

Privacy and storage

Nothing is uploaded and there is no account. Your best time for each level is saved in your browser’s local storage, as whole seconds inside a small JSON object, under one key. Stored times that are not whole seconds between 1 second and 99 hours 59 minutes 59 seconds are ignored when read. Only wins count. The level you last played is kept in the page address. Clearing site data removes the times.

Limits

  • Boards are random and are not checked for being solvable without a guess, so some games need one.
  • The timer counts whole seconds and pauses while the tab is hidden.
  • A long-press flags on touch and pen input only, not with a held mouse button.
  • Best times are per browser. There is no leaderboard and no sync between devices.
  • The share text is plain text, not an image.

Everything runs locally in your browser.

All Fun tools →

For informational purposes only. Not financial, medical, or legal advice. You are solely responsible for how you use these tools.