MineSweeper Class Reference
[Scripts for problems]
Example: Minesweeper
More...
Public Member Functions | |
| MineSweeper (const SizeOptions &opt) | |
| Actual model. | |
| virtual void | print (std::ostream &os) const |
| Print solution. | |
| MineSweeper (bool share, MineSweeper &s) | |
| Constructor for cloning s. | |
| virtual Space * | copy (bool share) |
| 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: MinesweeperThis is the classical MineSweeper game.
The instances are taken from http://www.janko.at/Raetsel/Minesweeper/index.htm
Definition at line 64 of file minesweeper.cpp.
Constructor & Destructor Documentation
| MineSweeper::MineSweeper | ( | const SizeOptions & | opt | ) | [inline] |
| MineSweeper::MineSweeper | ( | bool | share, | |
| MineSweeper & | s | |||
| ) | [inline] |
Member Function Documentation
| virtual void MineSweeper::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< Space >.
Definition at line 121 of file minesweeper.cpp.
| virtual Space* MineSweeper::copy | ( | bool | share | ) | [inline, virtual] |
Copy space during cloning.
Implements Gecode::Space.
Definition at line 145 of file minesweeper.cpp.
Friends And Related Function Documentation
const char* specs[] [related] |
const unsigned int n_examples = sizeof(specs)/sizeof(char*) [related] |
| int spec_size | ( | const char * | s | ) | [related] |
| 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 292 of file minesweeper.cpp.
The documentation for this class was generated from the following file:
- examples/minesweeper.cpp (Revision: 8649)
