Minesweeper-TUI is a command-line implementation of the Minesweeper game in C.


- Make sure you have the necessary requirements installed on your system.
- Clone the repository or download the source code files.
- Open a terminal and navigate to the directory containing the source code files.
- Compile the program by running the command
make
. - Run the program using the command
make run
.
- The board is a grid of cells, some containing mines.
- Numbers indicate how many mines are adjacent to that cell.
- Flag suspected mines to track them and avoid accidental clicks.
- Left-click on a numbered cell to quickly uncover surrounding cells if all adjacent mines are flagged.
- Uncover all empty cells to win. Hitting a mine ends the game.
🖱️ Left | uncover an undiscovered cell ( ■ ) |
---|---|
uncover the surroundings of a numbered cell ( 2 ) if all its adjacent mines are flagged | |
🖱️ Right | flag ( ⚑ ) an undiscovered cell as a mine spot |
🖱️ Middle | mark ( ? ) an undiscovered cell as a possible mine spot |
H | look at the history of the last played game |
R | restart the current game |
N | start a new game |
Q | quit the game or exit the program |
Run the install.sh
script to install missing dependencies
make
: Compiles the source code files and generates the executable file.make run
: Runs the program.make clean
: Deletes the executable file.make test
: Compiles the program in testing mode.
- This program has been tested on Windows Subsystem for Linux (WSL) with GCC installed. Compatibility with other systems may vary.
- To ensure proper rendering of the game board, it's recommended to use a monospace font that supports the Unicode symbols used by the game.
Feel free to modify the code and customize the game according to your preferences.
© 2023-2024 Ivano Izzo
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.