The Mechanics of Minesweeper

If you're not familiar with Minesweeper, chances are you already have the game on your computer. Microsoft created Winmine and has included it with Windows for as long as I can remember. The basic concept of the game is to clear all the boxes in the grid without blowing up. When you click on a box it will reveal either a bomb or a number. Hit the bomb and it's game over! The numbers represent how many bombs are in the adjacent boxes, where the maximum number of bombs possible which touch a single box is 8. If no number is displayed, then no bombs are present at the adjacent boxes. Also, when a blank box is revealed, it will spread out reveal all other blank boxes which touch it. Basically, a flood fill which is restricted by boxes containing numbers or bombs.

Once all available boxes have been reveal, leaving only the bombs covered, the player wins. At the beginner level, a board setup might be a 10x10 grid containing 10 bombs. With only 10% of the board containing bombs, typically you won't find any numbers higher than 3, with 2 and 1 being the most common. An expert level board might have 20% or more of the board covered in bombs, greatly increasing the challenge of avoiding them. To make things a little easier to manage, the player can mark a box with a question mark or a flag. The flag reminds the user they think that box contains a bomb. The question mark tells the player they are unsure and perhaps to just leave it unrevealed for now until they clear more of the board.