Skip to content

Latest commit

 

History

219 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minesweeper-TUI

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

menu board

Instructions

Running

  1. Clone the repository or download the executable.
  2. Run the executable (./minesweeper).

Compiling

  1. Make sure you have the necessary requirements installed on your system:
    • Make tool - make
    • GCC compiler - gcc
    • NCURSES library - libncurses-dev

    Run install.sh to automate the installation (apt only)

  2. Clone the repository or download the source code files.
  3. Navigate to the directory containing the source code files.
  4. Usage (make commands):
    • 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.

Gameplay

demo

  • 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.

Controls

🖱️ 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

Notes

  • 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.


Creative Commons License
© 2023-2024 Ivano Izzo
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

About

Command-line implementation of the Minesweeper game in C

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages