Minefield

Public domain classic

Clear the field without touching a mine.

Minefield

At a glance

Fields
Beginner 9 by 9 with 10 mines, Intermediate 16 by 16 with 40, Expert 30 by 16 with 99
Players
Solo
Controls
Click or tap to open a cell. Right-click, a press held for about half a second, or the Flag button and then a tap, places or lifts a flag. Drag to move a field that does not fit. Esc pauses
Clock
Starts with your first reveal. The final time is rounded up to whole seconds
Score
Clearing a field scores 10,000 minus the seconds taken. A lost field scores the number of cells you had open, the mine included
Saves
Your best time at each field size and your best score, in this browser only
Cost
Free, no account

How Minefield plays

  • Mines are laid after your first reveal, never on that cell or the eight around it, so the first cell always opens as a blank and spreads.
  • A number shows how many of the eight surrounding cells hold a mine. A blank cell has none, and it opens its neighbours for you, carrying on through further blanks and stopping at numbers.
  • A flagged cell will not open, by a tap or by that spreading, until you lift the flag. An open cell cannot be flagged.
  • The counter at the top is the mine total minus your flags. The game never checks a flag, so the counter can mislead you and can drop below zero.
  • You win when every cell without a mine is open. Flags are optional.
  • Opening a mine ends the field. Every mine is then shown, and the one you hit sits on a red cell.
  • Tapping an open number does nothing: there is no quick way to open all its neighbours at once.

What the tests showed

The rule test opened 300 fresh fields at each size from a random first cell. Every field had the right number of mines, none of them on or next to the first cell, and every number matched the mines around it. The first reveal opened between 6 and 66 cells on Beginner, 4 and 142 on Intermediate, and 6 and 132 on Expert.

The mines are shuffled at random, and the code does not check that a field can be finished by logic alone.

Reading the numbers

  • A number equal to its hidden neighbours: every one of those cells is a mine.
  • A number already matched by flags you are sure of: the rest of its neighbours are safe. Open them one by one, since there is no quick-open.
  • The first reveal is free. Mines are laid around it afterwards, so a first tap away from the edges clears a safe block of nine cells, against four in a corner.
  • Flags are only notes. Clearing the field needs every safe cell opened, not every mine flagged, so flag only where it helps you count.

Big fields on a small screen

On a 390 by 844 phone the game area is 352 pixels wide, and cells never shrink below 32 pixels. Beginner fits, but Intermediate is 512 pixels across and Expert 960, so drag the field to see the rest, sideways and up and down. A drag of more than 12 pixels moves the view and opens nothing. In the browser check the Expert field was dragged to its far corner and the bottom-right cell opened with a tap. At 1280 by 720 Expert fits, with cells about 37 pixels across.

For a logic puzzle with nothing hidden, try Sudoku.

Known limits

  • No undo.
  • No quick-open of a number's neighbours, and no keyboard play apart from Esc.
  • Nothing guarantees a field can be finished without a guess.
  • The Flag button switches itself off on every new field.
  • Changing the field size mid-game starts a fresh field.
  • A held press flags after 0.48 seconds. Move more than 12 pixels and it becomes a drag instead.
  • In a 1280 by 720 window the game area stands 848 pixels high, so the lower rows of a Beginner field sit under the window edge until you scroll.
  • Going to another tab pauses the game and the clock.
  • If storage is blocked, best times last only until the page closes.

How it was built and checked

AI tool
Codex
First committed
2026-10-14, in a batch of 10 classic games
Size
One HTML file of 179 lines, no game libraries
Rounds of changes
1, from the build record
Checked at build
A syntax check and three targeted rule checks: 10 mines laid on Beginner, the first cell and its neighbours kept clear, and blank cells spreading. The report names real browser rendering and physical touch devices as not verified
Checked since
2026-11-11: a new rule test (5,453 checks covering the three sizes, 900 first reveals, numbers, spreading, flags, the counter, wins, losses, the clock and the score, plus right clicks, long presses, the Flag button and dragging through the real pointer code), and an automated browser check of the local build at 1280 by 720 and 390 by 844. Each time it placed and lifted a flag (by right click on desktop, a long press on the phone), opened a Beginner field and then every safe cell to win, started again and switched to Expert. On desktop it also used the Flag button and lost a field on a mine. On the phone it dragged Expert to its far corner and opened a cell there
Played on a phone
2026-11-11, a full game on a real phone before this page went live

Embed Minefield on your site

Free to embed. Please keep the credit link.

<div style="position:relative;padding-top:75%;max-width:640px"><iframe src="https://aivibecodedgames.com/games/minefield/" title="Minefield (free browser game)" style="position:absolute;inset:0;width:100%;height:100%;border:0" loading="lazy" allow="fullscreen" allowfullscreen></iframe></div>
<p><a href="https://aivibecodedgames.com/play/minefield/">Play Minefield free</a> on AI Vibe Coded Games</p>

How it was vibe coded

ToolCodex
Rounds of changes: 1
First committed2026-10-14

The opening prompt

Make a minefield logic game (like the classic mine-clearing puzzle) with Beginner 9x9/10 mines, Intermediate 16x16/40, Expert 30x16/99. First click is always safe, flood-fill reveal of zeros, number colours, flags, mines-left counter, timer, win and lose states with all mines shown. Mobile flag toggle button. Never use the name Minesweeper. Best times per level in localStorage.

Game controls

  • Click or tap to reveal
  • Right-click, long-press or the flag toggle to mark a mine

The game brief includes touch controls for phones.

Open the game on its own

More games