Minesweeper
The flood fill on the first click is the whole project.
IntermediateWeb appGame8–16hAI-buildable 4/5no setupworth shipping
Classic Minesweeper, where the interesting code is the cascade: clicking an empty cell reveals every connected empty region and its numbered border in one go. Plus the rule that the first click is never a mine, which means placing mines after the board is first touched.
UI
Logic
Useful
Hosting · Free forever
Deploys free on GitHub Pages, Cloudflare Pages or Vercel Hobby.
Deploy it and share a link.
Core features · 7
- A grid with configurable size and mine count
- Left click reveals, right click flags
- Revealing an empty cell cascades through connected empty regions
- Numbers show adjacent mine counts
- The first click is guaranteed safe
- Win and lose detection with all mines revealed on loss
- A timer and remaining-flag counter
The interesting part
- Iterative flood fill, since deep recursion can blow the stack on large boards
- Placing mines after the first click without biasing the distribution
- Suppressing the browser context menu for right-click flagging
Once it works
- Add chording — click a satisfied number to reveal its neighbours
- Persist best times per difficulty
- Generate boards guaranteed solvable without guessing
Suggested stack
reacttypescripttailwind