Minesweeper for Android
An Android Minesweeper game built with Kotlin and Jetpack Compose.

A board drawn on Canvas
The game uses a 5 × 5 board with three mines. A single Compose Canvas draws the checkerboard tiles, numbers, mines, and flags. Tap coordinates are converted into a row and column; a long press selects the flag action. The ViewModel holds the board and game state, while the activity draws the current state.
A safe first move
Mines are placed only after the first tap, excluding that selected square. The game then calculates each cell’s neighboring-mine count. The timer starts with that first reveal and stops when the game ends.

Revealing an area
If a revealed cell has no neighboring mines, a recursive flood fill visits its neighbors. Already revealed cells and board boundaries stop recursion; numbered cells are revealed but do not expand further. The captured game shows the open area produced by this rule.
Winning, losing, and restarting
The assignment has two win conditions: reveal all 22 safe cells or flag all three mines. Revealing a mine loses the game, and flagging a safe cell also ends it. At the end, the app reveals every mine and shows a result dialog. Further board input is ignored until New Game resets the board and timer.