A C++ implementation of the Minesweeper game with both CLI and GUI interfaces.
- classic minesweeper gameplay with reveal, flag, chord and double-click chord
- CLI menu and GUI menu with the same game state
- leaderboard with CRUD, sorting and filtering
- recent match history
- multiple GUI themes:
Tokyo Night,OLED Black,Adwaita,Monokai - custom exception hierarchy and try/catch based error handling
- template utilities used in real gameplay logic
- STL containers and algorithms
std::stringeverywhere instead of manual C stringsIObjectinterface with unique ids and polymorphictoString()- singleton
ThemeManagerimplemented as a Meyers singleton - singleton
Loggerwith journal persistence and menu access - abstract factory for runtime theme selection
- builder for game setup creation
Linux / macOS:
./build.shWindows:
build.batThe scripts above build the project in CMake's Debug configuration by default,
which also enables the project's DEBUG macro inside the codebase.
To force a release build locally, pass the build type explicitly:
BUILD_TYPE=Release ./build.shbuild.bat ReleaseThe GitHub Actions workflow only builds Release binaries.
Build outputs:
build/minesweeper- CLI versionbuild/minesweeper-gui- GUI versionbuild/minesweeper-benchmark- benchmark utilitybuild/minesweeper-animation-demo- map generation animation demo
raylib- GUI renderingPCG- random number generation with AVX2 SIMD accelerationCMake- build systemC++23- language standard
To set up the environment on a clean Windows installation, run the following commands in PowerShell:
# 1. Install Scoop (Package Manager)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
# 2. Install Build Tools
scoop install gcc make cmake
# 3. Install Raylib (MinGW version)
scoop bucket add extras
scoop install raylib-mingwBuilds are produced with aggressive optimization flags for maximum performance:
-O3- Aggressive optimization level-march=native- CPU-specific instructions (AVX2, SSE4, etc.)-flto- Link-Time Optimization for whole-program optimizationPCG with AVX2- SIMD-accelerated random number generation
This project is licensed under the GNU General Public License v3.0.

