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

  • The game board is represented by a grid of cells.
  • Each cell may either be empty or contain a mine.
  • The goal of the game is to uncover all the empty cells.
  • Uncover a mine to lose 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
Q quit the game or exit the program
N start a new game
R restart the current game

Requirements

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.