subsection contents

Mine Sweeper

This is a clone of "Minesweeper" using JavaScript. The object of the game is to clear the minefield without detonating a mine. Currently only the "beginner" or "easy" level is provided. See below for notes.

Tested with Safari and Firefox on Mac OS X. According to Browsershots, the page loads and appears to work with Firefox, Chrome and Safari on Windows.

Click mode:
Time Elapsed:
Difficulty (3BV):


  • The timer starts once the first square is clicked on.
  • In "clear" mode, clicking on a square reveals what it contains: if there's a mine, it will be triggered; otherwise the number of mines in adjacent squares that touch this square will be revealed. For example, a cell touching two mines will appear as:  2 .
  • Clicking on a square with no adjacent mines will open up all non-mine squares surrounding it.
  • In "flag" mode, clicking on a square marks it to indicate that it contains a mine, i.e.  ⚑ . A flagged square is safe from detonation. To unflag a square, simply click on it again in "flag" mode.
  • In "query" mode, clicking on a square marks it to indicate that it may or may not contain a mine, i.e. . This can help evaluate alternative scenarios. A queried square is also safe from detonation. To "unquery" a square, simply click on it again in "query" mode, or use "flag" mode if you think it really does contain a mine.
  • An estimate of difficulty of a particular minefield is provided using the 3BV measure.
  • The status of the game is given, showing the number of potential mines flagged out of the number of actual mines.
  • If a mine is detonated, the locations of all mines will be displayed as:  ✴ . Any incorrectly flagged cells will be marked with an "X", i.e.  X .
  • The player can start a new game at any time by clicking on the "New Game" button, or reloading the page.
  • The symbols are actually Unicode characters using the Helvetica font. If the characters are not present on the user's machine, they will appear as rectangles. Earlier versions of Windows in particular seem to lack the necessary characters.

Future enhancements

  • Support for more browsers, and possibly allowing the user to select from common sets of symbols.
  • Keep track of best scores so far.
  • Provide larger playing grids.

Last updated: May 24, 2009