Example: Minesweeper More...
Public Member Functions | |
MineSweeper (const SizeOptions &opt) | |
Actual model. More... | |
virtual void | print (std::ostream &os) const |
Print solution. More... | |
MineSweeper (bool share, MineSweeper &s) | |
Constructor for cloning s. More... | |
virtual Space * | copy (bool share) |
Copy space during cloning. More... | |
![]() | |
ScriptBase (void) | |
Default constructor. More... | |
ScriptBase (bool share, ScriptBase &e) | |
Constructor used for cloning. More... | |
virtual void | compare (const Space &, std::ostream &os) const |
Compare with s. More... | |
Related Functions | |
(Note that these are not member functions.) | |
int | main (int argc, char *argv[]) |
Main-function. More... | |
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. More... | |
const unsigned int | n_examples = sizeof(specs)/sizeof(char*) |
Number of specifications. More... | |
int | spec_size (const char *s) |
Compute the size of a specification. More... | |
int | mineField (const char *s, int n, int i, int j) |
Return value at position (i,j) in the example s of size n. More... | |
Additional Inherited Members | |
![]() | |
static std::ostream & | select_ostream (const char *name, std::ofstream &ofs) |
Choose output stream according to name. More... | |
template<class Script , template< class > class Engine, class Options > | |
static void | run (const Options &opt, Script *s=NULL) |
Example: Minesweeper
This 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.
|
inline |
Actual model.
Definition at line 99 of file minesweeper.cpp.
|
inline |
Constructor for cloning s.
Definition at line 139 of file minesweeper.cpp.
|
inlinevirtual |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 121 of file minesweeper.cpp.
|
inlinevirtual |
Copy space during cloning.
Definition at line 145 of file minesweeper.cpp.
|
related |
The specifications.
Definition at line 183 of file minesweeper.cpp.
|
related |
Number of specifications.
Definition at line 282 of file minesweeper.cpp.
|
related |
Main-function.
Definition at line 156 of file minesweeper.cpp.
|
related |
Compute the size of a specification.
Definition at line 285 of file minesweeper.cpp.
|
related |
Return value at position (i,j) in the example s of size n.
Definition at line 292 of file minesweeper.cpp.