
Example: Word-square puzzle More...
Public Types | |
| enum | { BRANCH_WORDS , BRANCH_LETTERS } |
| Branching variants. More... | |
Public Member Functions | |
| WordSquare (const SizeOptions &opt) | |
| Actual model. More... | |
| WordSquare (WordSquare &s) | |
| Constructor for cloning s. More... | |
| virtual Space * | copy (void) |
| Copy during cloning. More... | |
| virtual void | print (std::ostream &os) const |
| Print solution. More... | |
Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace > | |
| ScriptBase (const Options &opt) | |
| Constructor. More... | |
| ScriptBase (ScriptBase &e) | |
| Constructor used for cloning. More... | |
| virtual void | compare (const Space &home, std::ostream &os) const |
| Compare with s. More... | |
Protected Attributes | |
| const int | w_l |
| Length of words. More... | |
| IntVarArray | letters |
| The array of letters. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| int | main (int argc, char *argv[]) |
| Main-function. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace > | |
| static std::ostream & | select_ostream (const char *sn, std::ofstream &ofs) |
| Choose output stream according to sn. More... | |
| template<class Script , template< class > class Engine, class Options > | |
| static void | run (const Options &opt, Script *s=NULL) |
Example: Word-square puzzle
From http://en.wikipedia.org/wiki/Word_square: A word square is a special case of acrostic. It consists of a set of words, all having the same number of letters as the total number of words (the "order" of the square); when the words are written out in a square grid horizontally, the same set of words can be read vertically.
Definition at line 59 of file word-square.cpp.
| anonymous enum |
Branching variants.
| Enumerator | |
|---|---|
| BRANCH_WORDS | Branch on word variables. |
| BRANCH_LETTERS | Branch on letter variables. |
Definition at line 67 of file word-square.cpp.
|
inline |
Actual model.
Definition at line 72 of file word-square.cpp.
|
inline |
Constructor for cloning s.
Definition at line 115 of file word-square.cpp.
|
inlinevirtual |
Copy during cloning.
Definition at line 121 of file word-square.cpp.
|
inlinevirtual |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 126 of file word-square.cpp.
|
related |
Main-function.
Definition at line 147 of file word-square.cpp.
|
protected |
Length of words.
Definition at line 62 of file word-square.cpp.
|
protected |
The array of letters.
Definition at line 64 of file word-square.cpp.