A console-based implementation of the classic Minesweeper game, built entirely in C.
This project provides a simple yet complete version of the Minesweeper game, playable directly in the terminal. It is an excellent example of a C program that uses structures, 2D arrays, and fundamental algorithms to create an interactive application.
- Classic Gameplay: A standard 8x8 grid with 10 hidden mines.
- Intuitive Controls: Reveal cells and place/remove flags with simple keyboard commands.
- Recursive Reveal: Automatically reveals all adjacent empty cells when you click on a cell with zero surrounding mines, just like the original game.
- Win/Loss Detection: The game clearly indicates when you've hit a mine (game over) or successfully cleared the board (victory).
- Dynamic Mine Placement: Mines are randomly placed at the start of each game to ensure a new challenge every time.
- Clone the repository:
git clone [your-repo-url]
- Navigate to the project directory:
cd minesweeper - Compile the code using a C compiler (like GCC):
gcc -o minesweeper minesweeper.c
- Run the executable:
./minesweeper
The game will print the board to the console.
- To reveal a cell, enter the row and column numbers separated by a space (e.g.,
3 4). - To place or remove a flag, enter
Ffollowed by the row and column (e.g.,F 3 4).
- Pranav Kiran Kumar - B.E. in Computer Science with Business Systems student.