Minesweeper (computer game)

From Free net encyclopedia

Minesweeper is a single-player computer game invented by Robert Donner in 1989. The object of the game is to clear a minefield without exposing a mine.

The game has been rewritten for many computer platforms and is most famous for the version that comes with Microsoft Windows.

Image:Minesweeper start.PNG Image:Minesweeper end.PNG Image:Minesweeper Dodec.png Image:Vista minesweeper.jpg

The game screen consists of a rectangular field of squares. Each square can be cleared, or uncovered, by clicking on it. If a square that contained a mine is clicked upon, the game is over. If the square did not contain a mine, one of two things can happen. A number could appear indicating the amount of adjacent (including diagonally-adjacent) squares containing mines. Or no number appears; in which case the game automatically clears those squares adjacent to the empty square (since they could not contain mines). The game is won when all squares that do not contain a mine are cleared.

The player can optionally mark any square believed to contain a mine with a flag, by right-clicking. In some implementations, middle clicking (or clicking both mouse buttons) on a number having as many adjacent flags as the value of the number reveals all the unmarked squares neighboring the number; the game ends on such an action if the wrong squares were marked. Some of those implementations also allow the player to move the mouse with the right mouse-button held down after marking mines; the player can then left-click on multiple numbered squares while dragging with the right mouse-button, in order to clear large areas in a short time.

Most implementations of minesweeper "cheat" in favor of the player by never placing a mine on the first square clicked; some also change the board so there are no 50-50 guess situations.

Contents

History

A lesser known game known as Relentless Logic (or RLogic for short) by Conway, Hong, and Smith, was available for MS-DOS as early as 1985. In RLogic, the player is a United States Marine Corps marine private, delivering an important message to the U.S. Command Center. RLogic and minesweeper are similar in concept, but a number of differences exist:

  • In RLogic, the player must navigate through the minefield, from the top left corner to the bottom right corner (Command Center).
  • It is not necessary to find all of the mines. Consequently, there is no mechanism for marking mines or counting the number of mines found.
  • The number of steps taken is counted. Although no high score functionality is included, players could attempt to beat their personal best score for a given number of mines.
  • Unlike Minesweeper, the size of the minefield is fixed. However, the player may still specify the number of mines.

Because the player must navigate through the minefield, it is sometimes impossible to win (without taking any risks) — namely, when the mines block all possible paths.

The connection between RLogic and Donner's Minesweeper is unclear. RLogic is undeniably the earlier game, but due to the simplicity of the concept, the similarities are quite possibly a coincidence. Relentless Logic has become virtually unknown whereas Minesweeper has remained popular.

Clearly the game is older than this, though. There was a version on a Tektronix 4051 around 1981, but the tradition of passing around a 'games tape' goes back to at least 1973 [1]. This tape even contains a 3D version of minesweeper. The author of this game, David Ahl [2] is a crucial figure in the early history of computer games.

Computer implementations

In the popular Microsoft Windows version, there are three sizes:

Beginner: 8 × 8 field with 10 mines
Intermediate: 16 × 16 field with 40 mines
Expert: 30 × 16 field with 99 mines.
Custom: Any values from 8 × 8 to 30 × 24 field, with 10 to 667 mines [the maximum number of mines allowed for a field of size A × B is (A-1) × (B-1)].

Newer versions of Windows (from Windows 2000 onwards) feature a 9 x 9 Beginner field instead of an 8 x 8, with the same number of mines. This was apparently because with the previous dimensions, the chances of clicking on a mine were the same for Intermediate and Beginner:

  • 8 × 8 = 64 squares, 10 mines / 64 squares = 15.625% chance of hitting a mine
  • 16 × 16 = 256, 40 mines / 256 squares = 15.625% chance of hitting a mine

In fact, when you allow for the starting square never containing a mine, there was a slightly higher chance of randomly hitting a mine in one move of the Beginner game. However, the Beginner game was still easier because it had fewer total chances of hitting a mine, and a smaller chance of having a problem that cannot be solved without guessing.

Alternatively, it could have been changed because controls had been increased in later Windows versions, thus allowing nine boxes to fit in a row of width equal to the title and score bars.

Another alternative: The beginner field is now solvable without guessing if a straight row of numbers with an opening on one side and unknown squares on the other side appears.

3D versions of the game are also available; one is called MineSweeper3D. Some versions of minesweeper also feature different 2D layouts. For example, X11-based XBomb adds triangular and hexagonal grids, and Professional Minesweeper for Windows includes these and many others.

A version of the game was also available for the Game Boy portable console.

In 2003, Microsoft added a variation of the original Minesweeper, called Minesweeper Flags in MSN Messenger (from version 6 onwards). This game is played against an opponent, and the objective of this game is to find the mines by actually clicking on the squares where they're located, not by clicking the surrounding squares. The person who has uncovered the most mines when the game is over, which happens when all mines are uncovered or the game is quit for any reason, has won.

Game analysis

Patterns

Naturally, there are many patterns that may arise during a game that can be recognized for their one possible solution. In the interest of finishing quickly, it is often easiest to process the known patterns first, and continue on with the uncertain parts later. This is especially important if a guess is required (see below), because if the guess fails, all efforts spent on other parts of the board will be lost.

For an example, the number one placed against a corner of a rectangular group of blocks indicates that the single square is a mine. This is by far the easiest pattern to recognize, though many more can be deduced with time.

In the advanced levels, a user may occasionally find the number eight when revealing a square. In this case, all of the surrounding squares contain mines.

The number three placed against a flat "wall" (often surrounded by twos) indicates three mines in a row, with the center being at the number three.

In a wall (no mines next to the side opposite the wall), where a two is beside a one, there will be a mine by the corner of the two that is away from the one. Many longer patterns can be derived from this one, including some of the following.

In a wall where a two appears between ones, the center square can be opened to find a number, and the two squares touching the ones will contain the two mines indicated by the two. The reason this makes sense is because if the mine were to be placed over the center square, you could not find any other mines adjacent to the "two" square because then one of the "one" squares would be touching two mines.

Where there is a row of twos by a wall, four twos with ones at the ends means that the mines are beside the two middle twos, and beside the ones adjacent to the twos; five twos in the same setting means that all twos except the centermost two are beside mines. These patterns are like extended versions of the patterns where one or two twos appear between ones, and the mines are located by the same principles as with those shorter patterns.

Unsolvable without guessing

Minesweeper is not always solvable without guessing. For instance, in the following situation:

Image:MinesweeperGuess.png

(Image:MinesweeperMine.png represents a mine, and the numbers are the standard Minesweeper numbers. The position is at the bottom of the board.)

The player must guess which of the two squares marked with a ? is a mine.

A few variants specifically focus on getting this aspect out of the game. At the simplest level, some programs give the solution away any time a guess is needed. Another one furthered the design and demands that the player decides if he or she has to guess or not. The resulting problem is always decidable (within an extended mathematical space). Yet another simply lets any guess the user makes (when they have to) automatically be the correct one.

NP-completeness

The following is an interesting problem: given a board position with the numbers, is it valid? In other words, is there some way that the mines could be arranged in the hidden squares that would be consistent with those numbers? This problem is known to be NP-complete. That means that it is easy to check whether a given arrangement of mines is consistent with the given numbers, but it is probably hard to find such an arrangement of mines, in some cases. This might mean that it's sometimes hard to play Minesweeper perfectly.

Because of Minesweeper's relation to mathematics here, it is mentioned in the Clay Mathematics Institute's unofficial description of one of the Millennium Prize problems, namely whether complexity class P equals NP.

Mine probabilities are not enough

If "playing Minesweeper perfectly" means finding a strategy that ensures the best probability of solving a random board, then there is more to playing perfectly than just choosing squares with lowest mines probabilities. Let's examine the following situation:

Image:MinesweeperGuess2.png

(As above Image:MinesweeperMine.png represents a mine, and the numbers are the standard Minesweeper numbers; a, b, c, d and e are the unknown positions.)

There is 2/3 probability of mine on a, b or c and 1/2 probability of mine on d, e; you can see that by computing the 6 possibilities of mine placement on a+b+c+d+e. But playing d or e will bring you no useful information: if you don't step on a mine, you'll see a 6 appear under e, or a 5 appear under d. Overall playing d or e will let you solve the area in only 1 of the 6 possible cases. If you play a (or b or c) and you don't die, you'll immediately know whether there is a mine on d or not; overall you'll solve the area in 2 of the 6 possible cases. So the moves a b c with the highest immediate danger turn out to be the best in the long run.

Best times

On the Windows version, for Expert, a time under 85 seconds in Windows 2000 (and under 80 seconds in Windows 3.1) is considered to be very good. The official record for Intermediate is 10 seconds and 1 second for the 8X8 Beginner board. The official record for Expert is 39 seconds. (Note that the timer instantly goes to 1 on the first click, rather than after a second.) Many people publish screenshots or video recordings of their best performances. The Minesweeper Community has compiled a bestever-list which includes videos of the fastest games ever played. In order to get on that list your records on beginner, intermediate and expert must sum up to no more than 99 (sub100).

The odds for winning Beginner (9x9 board) in a single click are as follows. Out of 127,800,681 games played in a row, by clicking in the corner, and seeing if all the squares get uncovered at once, 1,519 won on the first click. This gives an approximately 0.00119% chance of winning instantly, by clicking in the corner. In 6,713,134 games, clicking in the middle, 39 won on first click, giving only an approximately 0.00058% chance of winning instantly. In 10,839,687 games, clicking in the middle of an edge, 103 won on first click, giving an approximately 0.00095% chance of winning instantly. This could be more precisely calculated using combinatorial mathematics rather than statistics.

Cheat codes

Some Windows versions of Minesweeper have a cheat mode that uses the top-left pixel of the display to signal the presence or absence of a mine under the cursor. Start Minesweeper normally. When it has loaded, type "xyzzy <ENTER> <SHIFT-ENTER>". After doing this, the screen's top-left pixel will be white when the mouse pointer is on a square without a mine, and black when the pointer is on a square with a mine. This code works in Microsoft Windows 3.1, Windows for Workgroups 3.11, Windows NT 3.51, Windows 2000 and Windows XP. In Windows 95, Windows 98 and Windows NT 4.0, the pixel is only visible if the standard Explorer desktop is not running. Note that it is the SCREEN, not the top of the Minesweeper application. In Windows XP, it is necessary to click at least one square before the pixel accurately reports mine placement.

In some Windows versions, the file "winmine.ini" contains the high score table data. Editing this file changes the high score table accordingly, and can be used to falsify "high scores". This does not work on Windows XP.

In the most recent Windows version of Minesweeper, the high scores list has been moved into the registry.

Another cheat code can be used to stop the timer. After the timer has started hold down both the right and left button on the cursor and press escape (Esc). This does not work on Windows XP.

Alternatively, the timer can be stopped any time after it has started by pressing <Windows Key + D> to minimize the Minesweeper application, then immediately restoring it and selecting an unexplored tile. The timer will then remain frozen for the remainder of the current game. This only works on Windows XP.

The timer may also be stopped by clicking and holding the smiley face at the top of the minefield. Note that in order for this to work without simply causing a new game to start, you must move the pointer off of the face before releasing the mouse button.

Variations

There are variations of Minesweeper available for download at various places on the Internet. These are generally differently shaped minefields in two and three dimensions. There is also a game called "Nonosweeper", which applies Minesweeper-style graphics to a nonogram game. It shows a grid with groupings of numbers on the right side and bottom side. These numbers indicate clusters of mines. An example might be 2 1 2 3, denoting that there are clusters of 2, 1, 2, and 3 mines each separated by at least one empty space.

See also

  • 3BV - method to define the difficulty of boards

External links

Minesweeper Community

  • Planet Minesweeper - Comprehensive online resource for Minesweeper. Contains tips and advice, official bestever-list, many statistics and records, videos, cheats, links, downloads, active forum...
  • Feed- RSS feed containing all the new records of the Community.
  • The Authoritative Minesweeper - Unofficial Home of the Minesweeper Community.
  • Minesweeper Guestbook - Very popular guestbook for friends of Minesweeper. It is part of the Authoritative Minesweeper page.
  • rilian net - forum-based site contains full information about the Minesweeper game. Tips, game strategies and research articles, contests tables, Minesweeper emulators and tools to download, polls, links to other Minesweeper community sites. (rebuilding)
  • Minesweeper Active Ranking Page - Biweekly Score Submission and Ranking - Feel free to join
  • IRC-Chatroom for Minesweeper - irc.initialized.org port:6667 and join channel #minesweeper
  • Minesweeper Tournaments - International Minesweeper Tournaments and more

Minesweeper in science

Minesweeper strategies to get better times

  • Advanced tactics - Minesweeper page dedicated to explain how to handle guesses.

Minesweeper Clones/Variants

  • Minesweeper Clone - Clone based on the original Minesweeper, giving enhanced version of it, with many new features (like video-recording). Custom sizes up to 49 X 49, but custom sizes are not available in legal mode.
  • Minesweeper Arbiter - extremely secure Minesweeper clone with video recording, custom board sizes, statistics, cheat options, and a detailed help file.
  • Minesweeper X - a third Minesweeper clone with a load of features, like recording engine, simple statistics and custom skins support.
  • Hex Minesweeper - Free Minesweeper with a hexagonal grid. Must flag mines; remembers high scores.
  • Nonosweeper - Popular variation of Minesweeper using nonograms.
  • Ivanche Minesweeper - Good minesweeper clone with ability to scale window to any size and to select one of three font styles.
  • MineSweeper Java Applet - Play MineSweeper online.
  • MineSweeper3D - A 3D version of the game. (commercial, demo version available for download)
  • 3DMinesweeper - Another 3D version of the game. (commercial, trial version available for download)
  • Minesweeper 3D - Yet another 3D version of the game. (open source, public domain)
  • Crazy Minesweeper - Interesting minesweeper with mines of different power and other useful features.
  • XBomb - Minesweeper for X11 with hexagonal and triangular grids.
  • Ruckus Buck's Dangerous Mines - Minesweeper game with 3 game modes, one that is played in rounds against the clock. Windows and MacOS X
  • LuckySweeper - LuckySweeper. You are "automatically" lucky in case you have to guess.
  • Minesweeper - Freeware Minesweeper game with different graphics than Windows.
  • The Fastest, Best and Record Minesweeper Times - Website with a minesweeper program which automatically uploads your scores for ranking.
  • Mines-Perfect - Minesweeper with autosolver, many different boards, murphys-law-mode and much more.
  • Braingle Pirate's Booty - A twist on the game where instead of avoiding mines, you are trying to find treasures.
  • KMines - a KDE implementation.
  • Mines - a GNOME implementation, part of the Gnome Games package.
  • Crossmines - Freeware, shaped cells, linked cells, holes, timed game, score tables, many setup options.
  • Luminesweeper - an implementation for Game Boy Advance
  • Goobix Mines - a Minesweeper clone playable online without additional downloads.
  • Narkomania - another version of minesweeper.
  • Super Minesweeper - version of minesweeper with 7 gameplay modes and many boards.
  • Minimine - miniature (small screen footprint) freeware clone of expert Minesweeper.
  • Minesweeper Clones - Six excellent Minesweeper clones that are graphically identical to the original. A few have additional features.
  • XOMines - a rational Minesweeper that leaves nothing to chance - fairware, evaluation version is free.
  • KangarooIT Minesweeper - Java Applet Windows 98 Minesweeper Clone - playable online (Beginner/Intermediate/Expert)
  • Minesweeper clone in Simon Tatham's Portable Puzzle Collection which deliberately generates the mine layout in such a way that the player never has to guess. (Open source, MIT license)
  • Minesweeper Risk Game online variant with calculated risk, as clues are vertical, horizontal and diagonal totals.ca:Pescamines

de:Minesweeper es:Buscaminas fr:Démineur (jeu) ko:지뢰 찾기 it:Campo minato he:שולה המוקשים (משחק) nl:Mijnenveger (spel) pl:Saper (gra) ja:マインスイーパ simple:Minesweeper fi:Miinaharava (peli) sv:MS Röj zh:扫雷