Minesweeper is a version of the classic computer game in which players try to find the locations of mines hidden in a rectangular grid. In almost all other versions of the game the locations of the mines is entirely random and so guessing is generally required when trying to find them. The main distinguishing feature of the pzl version of minesweeper is that though the mine locations are randomly chosen, only grids which can be solved logically are displayed: if the player is smart enough, all puzzles can be solved without guessing. Why play a game where you can be defeated by bad luck, when you can instead play one in which only your skill determines the outcome?
To start a new game players left click anywhere on the grid. This reveals the content of a few squares around that position. Their content is a count of the number of mines that touch the square, zero being shown as a blank square. The first square will never contain a mine. Apart from those at the edge of the grid, each square touches 8 other squares (up, down, left, right and four diagonals). Players left click, in turn, on the squares they believe to be unmined. This reveals the content of the square. If the square is unmined the touching mine count is shown. If the square is mined the game is over and they have failed. Success comes when all the unmined squares are revealed. Optionally players mark the squares that they think are mined by using a right click. This places a flag in the square without revealing its contents. If the number of flags placed equals the number of mines but there are stil hidden mines the game is lost. Flags can be removed with a right click. Once the game has started, a click on a square that is not touching an exposed square will always reveal a mine! That is, random clicking in the hope of achieving a fast time is treated as cheating and rewarded accordingly.
At the top of the display is a Toolbar. The jigsaw piece button at the left is a menu which has options for setting the grid size, the hint algorithm modes and the maximum wait. Grid sizes are: easy, normal and expert. These correspond to puzzles with (squares across, squares down, mine count) values of (8,8,10), (16,16,40) and (30,16,99), respectively. The hint algorithm mode controls puzzle generation and player hints. The maximum wait times are defined in seconds. There is also an option for saving the current settings.
The toolbar has a flag for clearing the grid ready for a new game; a wand for selecting and executing hints; a thumb for checking and correcting flagging errors, and a sad smiley for showing the solution. To the right of this are 3 numbers. The first is the puzzle difficulty as a 3BV score, the next the curent number of hidden mines and the next a clock which ticks every 5 seconds. The program will not report flagging errors until the player clicks on the thumb or requests a hint. Errors are reported by the thumb turning down. A further click on the thumb will correct the error(s).
Minesweeper Worked Example
A video from minesweeper. The game is started by clicking anywhere in the grid. Minesweeper is all about speed. So we got a pensioner to make the demo. Though slow, she does well: right click to place a flag, left click to reveal a cell. Occasionally she clicks the thumb to check that all the flags are correct. After a while she demonstrates the hint button which marks a cell which can be deduced given the current state of the board, but she clicks again so that the program fills in the answer. A bit later she "demonstrates" what happens if you reveal a mine.
The program uses two algorithms to create logical puzzles and provide hints. The first algorithm, which uses simple patterns, is always used, but the second, which recognises more complicated patterns, is optional. When a hint is shown the program marks them using two different smiley faces so that the player knows how hard it will be to understand why the contents of the square under the smiley can be deduced.
Simple Hint Example
An example of a simple hint. The program has recognised that the "1" at position 5,7 is only touching one unexposed square, and to get a count of 1 it must touch a mine. Therefore the square under the smiley is a mine. Note the smiley used.
Hints are provided in two stages: the first click on the hint button will cause the program to place an appropriate smiley on the square it has worked out is fully determined by its neighbours. At this stage players can deduce for themselves whether the smiley covers a mine or an unmined square and set it accordingly. That is, the program has simply directed their attention to a solvable square. However, if they are unsure, a second click on the hint button will automatically flag or reveal the square.
The simplest algorithm examines the counts for the each exposed cell to see if they can be accounted for by their immediate neighbours. For example if a cell has a mine count of 2 and is touching exactly one flagged cell and exactly one hidden cell, then the hidden cell must be a mine. An example of the simplest case is shown in the adjacent screenshot.
The second algorithm relies on recognising configurations of squares and mine counts which at first may seem could be accounted for by more than one arrangement of mines, but which more careful analysis reveals are satisfied by only one. An example is shown in the adjacent screenshot entitled "Complex Algorithm", with the solution in the screenshot entitled "Finished Puzzle". Experts learn to recognise these patterns very quickly.
Complex Hint Example
An example of a complex hint. The program has placed a smiley on square 8,3. Is it a mine? The 3 at 7,4 needs to touch one more mine and the column of 1s below it must all touch a mine. By considering all possibilities it will be recognised that the only possible arrangement is that shown in the final screenshot. Note the smiley used.
Complex Hint Solution
A screenshot from minesweeper showing the only possible arrangement of mines for the complex algorithm example.
Configuration options are available from the puzzle menu. Grid sizes are named "easy", normal and expert and correspond to (squares across, squares down, mine count) values of (8,8,10), (16,16,40) and (30,16,99), respectively.
The algorithm mode is either "Simplest Only", or "Both". This choice will be used both for puzzle generation and for providing hints. Their meaning is outlined in Using Hints. Note, however, that for "expert" grids the program will always use both algorithms.
The program only produces puzzles that can be solved logically. To achieve this, when the player clicks on a starting square to request a new game, the program continually generates random mine patterns until it finds one it can solve using the current hint algorithm settings. This one is displayed for the player to try. The generation and analysis takes time. For "easy" and "normal" grids it is apparently instantaneous, and therefore not a problem, but for "expert" grids it can take an appreciable time. For this reason the program has a large built-in backup supply of already generated expert puzzles (between 50 and 80 puzzles for each starting square). In the puzzle menu there's an option "Maximum Wait". This value determines how many seconds the program will try to generate a new expert puzzle before giving up and displaying one of its built-in grids. If this becomes necessary the program randomly chooses one of the 50 to 80 grids for the clicked start square.
Two types of error are possible. Firstly, if players use flags to show where they believe there are mines they might flag an unmined square. The second type of error is more dramatic: if players reveal a mine the game is over and the program automatically produces a display like the one shown in the screenshot entitled "Whoops".
A screenshot from minesweeper showing what happens when a player reveals a mine. Unexposed mines are shown on a white background, incorrectly flagged squares as mines covered by a red cross, and the square the player revealed is shown as a mine on a red background.
To check if they have flagged unmined squares players can click on the hand icon in the Toolbar. If the thumb turns down the grid contains at least one error. Players can then try to work out the mistakes and unflag them. Alternatively, another click on the hand icon will unflag all incorrectly flagged squares. Note that the hint option will not operate if there are flagging errors. If that is the case, a request for a hint will also result in the thmb being turned down and the hint button will become inoperative.