The Oz Minesweeper
This application looks like the usual minesweeper game. The playing
field is a grid of squares, each of which may hide a mine. The total
number of mines is given when the game starts. The objective is to find
out where they are located. The rules are:
- You uncover a square by clicking on it. If you explode a mine,
the game is over. Otherwise, the number in the square gives the
number of adjacent mines.
- You mark a square as a mine by clicking on it with the middle
button of your mouse. This helps to visualise your knowledge about
- You win the game when all the non-mined squares have been
uncovered. To help you, a counter in the window indicates the number
of remaining squares to be uncovered.
The digital assistant
This application is definitely more than the usual minesweeper
game. The checkbuttons under the mine field (see screenshots)
enable/disable modules of a digital assistant. The latter is
a software component that augments the knowledge about the hidden
mine field. Briefly, the modules are:
The assistant is called intelligent thanks to the latter
module. This is because it is able to solve nontrivial problems.
- This module automatically uncovers the squares that are
- Zero propagation
- The module implements the following inference rule: if a square is
uncovered and shows a ``0'', then all the squares around it are known
safe. It is the simplest form of intelligence for this game. Usual
implementations of the game never provide more than this.
- This one uses the power of constraint programming in Oz.
It implements the general rule: if a square is uncovered and shows
number x, then x squares around it are mined. The
module propagates lots of information and automatically marks squares
as safe (with a ``-'') or mined (with a ``X'').
When used in conjonction with Autoplay, it is able to uncover large
parts of the game field.
The module also provides a search tool: if you click on a
square with the right button of the mouse, the assistant searches for
the common part of all the solutions of the mine field around
the target square. The searched part is the squares at the frontier
between the known and unknown squares, of which the target square is a
You first need to install
version 1.2.0 and enable Oz applets in your internet browser.
to make the whole thing. Then launch
The source files are: