Microsoft Minesweeper first shipped in the 1990 Windows Entertainment Pack for Windows 3.11 and stayed bundled in every Windows release until Windows 8 in 2012 (verified against en.wikipedia.org/wiki/Minesweeper_(video_game) on 2026-08-12). Almost every browser-game weekender who wants to relearn the classics starts with how to make Minesweeper, gets the grid rendering fine, then hits a wall on the flood-fill reveal or the first-click safety guarantee, and quietly abandons the project. The 2026 pipeline is very different: plain DOM renders the flag grid for free with a CSS grid of buttons, a coding agent scaffolds the four states in one prompt, and the whole game ships in a weekend. In a browser, that means WizardGenie to scaffold the grid, seed logic, and flood-fill reveal already wired, Sorceress AI Image Gen for optional custom tile numerals or a themed skin, SFX Gen for the tile-click blip and the mine-boom, and Music Gen for an ambient background loop that keeps tension without distracting from the puzzle. This guide is the honest end-to-end for how to make Minesweeper in 2026.
What “how to make Minesweeper” actually means in 2026
The query “how to make Minesweeper” hides two very different requests. Some searchers want an honest tribute to the 1990 Microsoft original — the beveled gray tiles, the yellow smiley face reset button, the seven-segment red-LED timer and mine counter, and the specific number colors (1 blue, 2 green, 3 red, 4 dark blue, 5 dark red, 6 teal, 7 black, 8 gray). Some searchers want a modernised interpretation — flat cells, custom themes, animated cascades, achievements, and a daily seed. This guide targets the mechanic first and lets you style either way, because the mechanic is what the query is really about. The Microsoft aesthetic is a specific commercial product; the flag-grid pattern is a game-design pattern that predates Microsoft by seven years (Ian Andrew’s Mined-Out on the ZX Spectrum, 1983, per the Eurogamer history archived on en.wikipedia.org/wiki/Minesweeper_(video_game), verified 2026-08-12).
A quick trademark note before the technical section starts. Microsoft owns the Microsoft Minesweeper trademark, the specific bitmap art assets from every Windows release, and the branded reset-smiley icon set. You cannot name your game Minesweeper on a store page or use any Microsoft-owned art. The core mechanic — a grid of clickable cells, hidden mines, adjacent-count numbers, right-click flags, and flood-fill reveal on zero-count cells — is a game-design pattern, and game-design patterns are not protected by copyright or trademark. Dozens of published clones since 1983 (Mined-Out on the ZX Spectrum, Tom Anderson’s SunOS Mines in 1987 ported to XWindows in 1990, KDE’s KMines, GNOME’s Mines, Palm OS Mines, and countless browser rewrites) built on the same mechanic under different names. Pick a different name for your build (Flag Grid, Sweep, MineHunt, Field), draw your own art, write your own code, and you stand on the same fair-use footing.
The Minesweeper game loop in one minute (click reveal flag win)
Four moving parts and nothing else, in a strict order per player action. First, on left-click of an unopened non-flagged cell, if this is the first click of the game, seed the mines now (avoiding the clicked cell and its eight neighbors) and compute the adjacent-mine count for every non-mine cell. Second, reveal the clicked cell — if it is a mine, freeze the loop, flip every remaining mine to visible with the clicked mine drawn in red, and show GAME OVER. If it is not a mine and its adjacent-count is greater than zero, just reveal the number. If it is not a mine and its adjacent-count is zero, flood-fill reveal every unrevealed non-flagged neighbor via breadth-first search until every zero-count cell in the connected region is opened. Third, on right-click of an unopened cell, toggle the flag state (or cycle unopened → flagged → question → unopened if you want the classic three-state cycle). Fourth, after every reveal, check win — if the count of revealed non-mine cells equals total-cells minus mine-count, freeze the loop, auto-flag the remaining mines, and show YOU WIN with the elapsed timer.
That is the entire game. Four steps, driven by two mouse events (click and contextmenu) on a CSS grid of buttons or a single Canvas element with a hit-test on click coordinates. Everything else — the yellow smiley face reset button that turns to a frown on death and shades on click, the seven-segment red-LED mine counter and timer, the beginner/intermediate/expert board presets, the chord click (both mouse buttons at once to auto-reveal neighbors of a fully-flagged number), the daily-seed rotation, the local high-score board — is polish layered on top of these four steps. If you keep the loop tight and first-click safety in place, the browser build feels like Windows 95 even on a mid-range phone. Fight the temptation to write animated cascades or particle explosions on the first pass. Ship the pure four-step loop, then extend.
Pick your engine for how to make Minesweeper: React, vanilla DOM, or Phaser 4
Three good browser targets in 2026, each with a very different trade-off. Plain DOM (a CSS grid of <button> elements) plus a small JavaScript state model is the honest default and the one this guide recommends for a first build. Minesweeper is a grid of clickable rectangles with a small number and a fixed color per state, which is exactly what the DOM was designed to render. A working build is roughly 250 lines of JavaScript and 40 lines of CSS. Right-click flagging is a one-line event.preventDefault() call on the contextmenu event. Using real buttons means you get keyboard focus, tab navigation, and screen-reader accessibility for free — a genuine win over Canvas.
React is the right pick if you already know it or if you plan to hoist the game inside a larger app (a game portal, a game jam entry that shares nav with other games, a daily-puzzle site with a leaderboard). The Minesweeper state is a two-dimensional grid of cell objects; every click computes a new grid and setState triggers a rerender. React 19 handles this pattern comfortably at 30x16 Expert board size. Do not use React just because it is the framework you happen to have installed; the DOM version is smaller and faster for a standalone game.
Phaser 4.2.1 “Giedi” (released 9 July 2026, verified against phaser.io/download/stable on 2026-08-12) is the right choice if you plan to extend the game with animated tile reveals, particle explosions on the mine hit, a smooth-scrolling infinite grid, or a custom theme system that swaps sprite sheets at runtime. Phaser bundles Scene management, an asset loader, input, and audio playback in one file — roughly 900 KB minified, which is fine for a mobile browser build. It is also the pick if you have already used Phaser on a previous project and know the framework; there is no advantage to switching to plain DOM just because Minesweeper is small.
WizardGenie is not a separate rendering engine — it scaffolds whichever of the above you pick, from a single natural-language prompt. WizardGenie is the Sorceress game-native coding agent. It ships as both a desktop app (Windows installer with auto-update, available to Early Access supporters and above) and a no-install web build at the same URL. Its coding-model lineup (verified 2026-08-12 in src/app/_home-v2/_data/tools.ts lines 734 to 743) covers Claude Opus 4.7, Claude Sonnet 4.6, GPT-5.5, Gemini 3.1 Pro, DeepSeek V4 Pro, Kimi K2.5, Grok 4.2, and MiniMax M2.7. For a Minesweeper-scale project, any of the frontier models scaffolds the whole game in one prompt. If you want to run cheap, pair a frontier planner (Claude Opus 4.7 or GPT-5.5) with a budget executor (DeepSeek V4 Pro or Kimi K2.5) and let the executor do the typing.