This is a simple prototype of the classic Minesweeper game built using SwiftUI. The game features an 8x8 grid with randomly placed mines, and players can reveal cells, flag potential mines, and win or lose based on their choices.
- 8x8 Grid: A standard Minesweeper grid with 10 mines.
- Cell Interaction: Tap to reveal cells and long press to flag potential mines.
- Adjacent Mine Count: Displays the number of adjacent mines for each revealed cell.
- Game Over and Win Conditions: Detects when the player hits a mine or reveals all non-mine cells.
- New Game Button: Restart the game at any time.
- Xcode 12 or later
- Swift 5.0 or later
- iOS 14.0 or later
To install the Minesweeper game prototype, follow these steps:
-
Clone the repository:
git clone https://github.com/kstbyev/minesweeper.git
-
Navigate to the project directory:
cd minesweeper -
Open the project in Xcode:
open minesweeper.xcodeproj
-
Build and run the project on a simulator or a physical device.
- Start the Game: Launch the app to start playing Minesweeper.
- Reveal Cells: Tap on a cell to reveal it. If it contains a mine, the game is over.
- Flag Cells: Long press on a cell to flag it as a potential mine.
- Winning the Game: Reveal all non-mine cells to win the game.
- Restarting the Game: Click the "New Game" button to reset the game state.
Contributions are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request.
- Inspired by the classic Minesweeper game.
- Built with SwiftUI for a modern user interface.
