Generated on Mon Aug 25 11:35:48 2008 for Gecode by doxygen 1.5.6

MineSweeper Class Reference
[Scripts for problems]

Inherits Example.

List of all members.


Detailed Description

Example: Minesweeper

This is the classical MineSweeper game.

The instances are taken from http://www.janko.at/Raetsel/Minesweeper/index.htm

Definition at line 61 of file minesweeper.cc.


Minesweeper specifications

A specification is a square matrix of characters. Alphanumeric characters represent the number of mines adjacent to that field. Dots represent fields with an unknown number of mines adjacent to it (or an actual mine).

const char * specs []
 The specifications.
const unsigned int n_examples = sizeof(specs)/sizeof(char*)
 Number of specifications.
int spec_size (const char *s)
 Compute the size of a specification.
int mineField (const char *s, int n, int i, int j)
 Return value at position (i,j) in the example s of size n.

Public Member Functions

 MineSweeper (const SizeOptions &opt)
 Actual model.
virtual void print (std::ostream &os)
 Print solution.
 MineSweeper (bool share, MineSweeper &s)
 Constructor for cloning s.
virtual Spacecopy (bool share)
 Copy space during cloning.

Constructor & Destructor Documentation

MineSweeper::MineSweeper ( const SizeOptions opt  )  [inline]

Actual model.

Definition at line 92 of file minesweeper.cc.

MineSweeper::MineSweeper ( bool  share,
MineSweeper s 
) [inline]

Constructor for cloning s.

Definition at line 132 of file minesweeper.cc.


Member Function Documentation

virtual void MineSweeper::print ( std::ostream &  os  )  [inline, virtual]

Print solution.

Reimplemented from Example.

Definition at line 114 of file minesweeper.cc.

virtual Space* MineSweeper::copy ( bool  share  )  [inline, virtual]

Copy space during cloning.

Implements Gecode::Space.

Definition at line 138 of file minesweeper.cc.


Friends And Related Function Documentation

const char* specs[] [related]

The specifications.

Definition at line 176 of file minesweeper.cc.

const unsigned int n_examples = sizeof(specs)/sizeof(char*) [related]

Number of specifications.

Definition at line 275 of file minesweeper.cc.

int spec_size ( const char *  s  )  [related]

Compute the size of a specification.

Definition at line 278 of file minesweeper.cc.

int mineField ( const char *  s,
int  n,
int  i,
int  j 
) [related]

Return value at position (i,j) in the example s of size n.

Definition at line 285 of file minesweeper.cc.


The documentation for this class was generated from the following file: