A classic Minesweeper implementation using C++ and the Raylib graphics library.
This is a simple implementation of the classic Minesweeper game. The player must reveal all cells without mines to win, using number clues to identify where mines are located.
- 10×10 game grid
- Graphical UI with flag and mine indicators
- Game timer
- Win/lose detection
Make sure you have the following installed on your system:
- C++ compiler (g++)
- Raylib library
- X11 development libraries
- Clone this repository:
git clone https://github.com/Anchal-T/minswepper cd minesweeper - Ensure Raylib is installed on your system. The Makefile expects it to be in
$(HOME)/raylib/src. - Compile the game using
make:make
./minesweeper- Left-click: Reveal a cell
- Right-click: Place/remove a flag
- R key: Restart the game
- ESC key: Exit the game
- Reveal all non-mine cells to win.
- If you reveal a mine, you lose.
- Numbers indicate how many mines are in the adjacent cells.
- Use flags to mark cells you think contain mines.
minesweeper/
│── minesweeper.cpp # Main source code
│── resources/ # Contains game assets
│ ├── minesweeper_bomb.png # Mine image
│ ├── minesweeper_flag.png # Flag image
│── Makefile # Build configuration
To compile the game, simply run:
makeTo clean the build files:
make clean