A classic Minesweeper game built with React.
- Classic Minesweeper gameplay
- Customizable grid sizes and mine counts
- Responsive design for mobile and desktop
- Timer to track your progress
- Flagging and revealing functionality
- Simple and intuitive UI
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/Njancodes/React-Minesweeper.git cd React-Minesweeper
-
Install the dependencies:
npm install
-
Start the development server:
npm start
The app will be available at http://localhost:3000
.
- Start a New Game: Choose your preferred grid size and number of mines.
- Revealing a Cell: Click on a cell to reveal it. If it's a mine, the game is over.
- Flagging a Cell: Right-click on a cell to flag it as a mine. Right-click again to remove the flag.
- Winning the Game: Reveal all cells that are not mines.
- Objective: The objective of the game is to clear a rectangular board containing hidden "mines" without detonating any of them, with help from clues about the number of neighboring mines in each field.
- Revealing a Cell: If a player reveals a mine, they lose. Otherwise, the revealed cell will display a number indicating how many mines are adjacent to it. If no mines are adjacent, it will be blank, and the adjacent cells will automatically be revealed.
- Flagging Mines: Players can flag cells they suspect contain mines. Flagging is purely for the player's reference and does not affect gameplay mechanics.
- Winning: The game is won when all non-mine cells are revealed.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes.
- Push your branch to your forked repository.
- Open a pull request detailing your changes.