The link above launches the Oz Minesweeper as an Oz applet.
You need
version 1.3.0 or later to be installed on your system.
In order to launch the application with a single click, you have to
enable Oz applets in your internet browser.
Consult the
Mozart Installation Manual
if necessary.
The source files are packed in OzMine.zip.
To build the application, unpack the file, enter the directory
OzMine, and run make (for the executable), or
make oza (for the applet).
I have submitted a paper to the Second International Mozart/Oz Conference MOZ2004. The paper describes how I used constraint programming to implement a solver for the game. Using constraint programming is appropriate, since the Minesweeper is NP-complete (by Richard Kaye).
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:
This application is definitely more than the usual minesweeper game. It provides a digital assistant, which consists in several inference engines and one search engine. The digital assistant is based on techniques from the field of constraint programming, for which Oz has valuable support. As it is capable of solving a nontrivial problem, the digital assistant can be called ``intelligent''.
The inference engines are controlled by the checkbuttons on the right of the mine field. When active, they augment the knowledge about the hidden mine field. The user interface shows this in the squares. Safe positions are marked with a dash (-) until they are played. Mine positions are marked with a black circle, suggesting a bomb. OzMine currently provides four inference engines.
The Search engine is triggered by the user, and basically solves the whole problem. It considers all the possible mine fields, and computes their mean. This mean value gives a probability for each square to be mined. The probabilities are shown on the board as filled rectangles. The precise value for a square is shown below the search button when the user places the mouse cursor on the square.
Actually the search engine does not compute all the solutions of the problem. This is simply impossible. For instance, a 10x10 field with 20 mines has 5.36x1020 solutions when the game starts! It first reformulates the problem, using similar techniques to the Set Constrains engine above, and solves this new problem. It has much less variables, and much less solutions. Details are given in the paper.