Mine Sweeper
SwiftUI • LazyVGrid • Difficulty Modes • Game Logic
About
Built a Minesweeper game in SwiftUI with dynamic board sizing, multiple difficulty levels, and full reveal / flag gameplay. The app generates randomized mine placement, computes adjacent mine counts, supports tap-to-reveal and long-press flagging, and uses a flood-reveal routine to open connected empty cells.
What it includes
- Easy, medium, and hard modes with different board sizes and mine counts
- LazyVGrid-based board rendering that scales to fit the screen
- Random mine placement and adjacency counting for each cell
- Tap to reveal, long press to flag, and loss handling when a mine is hit
- Flood-fill reveal logic and win detection based on correctly flagged mines
Tech Stack
Swift
SwiftUI
LazyVGrid
Game Logic
State Management
iOS