Prompt
Implement the core logic functions for Minesweeper.
Write three pure functions:
createBoard()— returns an 8x8 board with 10 bombs placed randomly. Each cell: { bomb: boolean, adjacent: number, revealed: boolean }revealCell(board, r, c)— returns a NEW board with cell (r,c) revealed. If adjacent=0, auto-reveal neighbors (flood fill). Bomb cells are never revealed by this function — the UI detects the bomb tap and handles game over.checkWin(board)— returns true if all non-bomb cells are revealed.
Live Preview
Mines: 10
Hints
Solution
Your Code
20 min