Skip to content

Command-line implementation of the Minesweeper game in C

Notifications You must be signed in to change notification settings

bepposax/minesweeper-tui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minesweeper-TUI

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

menu board

Instructions

  1. Make sure you have the necessary requirements installed on your system.
  2. Clone the repository or download the source code files.
  3. Open a terminal and navigate to the directory containing the source code files.
  4. Compile the program by running the command make.
  5. Run the program using the command make run.

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

Requirements

Run the install.sh script to install missing dependencies

Usage

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

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

Watchers

Forks

Releases

No releases published

Packages

No packages published