A classic Minesweeper desktop game built with WPF and C#. Supports three difficulty presets, a custom game mode, and an auto-expanding flood-fill reveal — all in a clean, native Windows desktop experience.
- Three difficulty levels — Easy (9×9, 10 mines), Medium (16×16, 40 mines), Expert (30×16, 99 mines)
- Left-click to reveal a cell; stepping on a mine ends the game
- Right-click to place or remove a flag on a suspected mine
- Flood-fill reveal — clicking an empty cell recursively uncovers all connected empty cells and their numbered borders
- Live mine counter — shows remaining unflagged mines, updated in real time via data binding
- Custom game mode — configure board width, height, and mine count (manual or auto-generated) in a dedicated settings dialog
- Win detection — game congratulates you when all mines are correctly flagged
| Language | C# 7 |
| Framework | .NET Framework 4.7.2 |
| UI | WPF (Windows Presentation Foundation) |
| Data binding | INotifyPropertyChanged for live mine counter updates |
| Algorithm | Recursive DFS flood-fill for zero-cell propagation |
| Architecture | Code-behind with a separate settings dialog window |
- Windows OS
- Visual Studio 2019 or later with the .NET desktop development workload
git clone https://github.com/your-username/minesweeper.git- Open
WpfApp22/WpfApp22.slnin Visual Studio - Press F5 to build and run
| Action | Result |
|---|---|
| Left-click a cell | Reveal it |
| Right-click a cell | Place / remove a flag |
| Flag all mines correctly | Win! |
| Click a mine | Game over |
Use the menu to switch difficulty or open Custom Settings to define your own board size and mine count.
MIT © 2026 Denis Mikhalev

