Skip to content

twopranav/Minesweeper-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Minesweeper

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.

✨ Features

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

πŸš€ How to Run

  1. Clone the repository:
    git clone [your-repo-url]
  2. Navigate to the project directory:
    cd minesweeper
  3. Compile the code using a C compiler (like GCC):
    gcc -o minesweeper minesweeper.c
  4. Run the executable:
    ./minesweeper

▢️ How to Play

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 F followed by the row and column (e.g., F 3 4).

πŸ‘¨β€πŸ’» Author

  • Pranav Kiran Kumar - B.E. in Computer Science with Business Systems student.

About

Functioning backend of Minesweeper written in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages