A fast, lightweight Minesweeper clone for the terminal, written in modern C++23.
- Modern C++: Built using the latest C++23 standards.
- TUI Interface: Pure terminal-based gameplay using standard POSIX terminal controls.
- Difficulty Levels:
- Beginner: 9x9 board with 10 mines.
- Intermediate: 16x16 board with 40 mines.
- Expert: 30x16 board with 99 mines.
- Customizable: Logic separated into a modular
Boardclass and aGameorchestration layer.
| Key | Action |
|---|---|
W, A, S, D |
Move cursor |
Space |
Reveal cell |
F |
Toggle flag |
Q |
Quit game |
- C++23 Compiler: (e.g., GCC 13+ or Clang 16+)
- CMake: 3.31 or higher
- Nix (Optional): A
flake.nixis provided for a reproducible development environment.
If you have Nix installed with Flakes enabled, you can enter the development shell or run the project directly:
nix develop
# Then follow the CMake build steps below, or:
nix run-
Create a build directory:
mkdir build && cd build
-
Configure the project:
cmake ..
-
Compile:
make
After building, you can run the executable from the build directory:
./tsweepBoard: Manages the grid state, mine generation, and cell revealing logic.TerminalHandler: Manages terminal state, raw mode, and screen clearing.Game: Orchestrates the game loop, input processing, and rendering.