Generated on Tue May 22 09:40:49 2018 for Gecode by doxygen 1.6.3

MineSweeper Class Reference
[Example scripts (models)]

Example: Minesweeper More...

List of all members.

Public Member Functions

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

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.

Detailed Description

Example: Minesweeper

This is the classical MineSweeper game.

The instances are taken from

Definition at line 60 of file minesweeper.cpp.

Constructor & Destructor Documentation

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

Actual model.

Definition at line 95 of file minesweeper.cpp.

MineSweeper::MineSweeper ( MineSweeper s  )  [inline]

Constructor for cloning s.

Definition at line 135 of file minesweeper.cpp.

Member Function Documentation

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

Print solution.

Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.

Definition at line 117 of file minesweeper.cpp.

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

Copy space during cloning.

Definition at line 141 of file minesweeper.cpp.

Friends And Related Function Documentation

const char* specs[] [related]

The specifications.

Definition at line 179 of file minesweeper.cpp.

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

Number of specifications.

Definition at line 278 of file minesweeper.cpp.

int spec_size ( const char *  s  )  [related]

Compute the size of a specification.

Definition at line 281 of file minesweeper.cpp.

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 288 of file minesweeper.cpp.

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