Example: Word-square puzzle More...
Public Types | |
enum | { BRANCH_WORDS , BRANCH_LETTERS } |
Branching variants. More... |
Public Member Functions | |
WordSquare (const SizeOptions &opt) | |
Actual model. | |
WordSquare (WordSquare &s) | |
Constructor for cloning s. | |
virtual Space * | copy (void) |
Copy during cloning. | |
virtual void | print (std::ostream &os) const |
Print solution. | |
Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< Space > > | |
ScriptBase (const Options &opt) | |
Constructor. | |
ScriptBase (ScriptBase &e) | |
Constructor used for cloning. | |
virtual void | compare (const Space &home, std::ostream &os) const |
Compare with s. | |
Public Member Functions inherited from Gecode::Driver::IgnoreStepOption< BaseSpace > | |
IgnoreStepOption (const Options &) | |
Constructor. | |
IgnoreStepOption (BaseSpace &e) | |
Constructor used for cloning. |
Protected Attributes | |
const int | w_l |
Length of words. | |
IntVarArray | letters |
The array of letters. |
Related Symbols | |
(Note that these are not member symbols.) | |
int | main (int argc, char *argv[]) |
Main-function. |
Additional Inherited Members | |
Static Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< Space > > | |
static std::ostream & | select_ostream (const char *sn, std::ofstream &ofs) |
Choose output stream according to sn. | |
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< Driver::IgnoreStepOption< Space > >.
Definition at line 126 of file word-square.cpp.
|
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.