MCPcopy Create free account
hub / github.com/Gecode/gecode / print

Method print

examples/minesweeper.cpp:116–132  ·  view source on GitHub ↗

Print solution

Source from the content-addressed store, hash-verified

114
115 /// Print solution
116 virtual void
117 print(std::ostream& os) const {
118 for (int h = 0; h < size; ++h) {
119 os << '\t';
120 for (int w = 0; w < size; ++w) {
121 int v = mineField(spec, size, h, w);
122 if (v != -1)
123 os << v << " ";
124 else if (pos(h,w).val() == 1)
125 os << "* ";
126 else
127 os << ". ";
128 }
129 os << std::endl;
130 }
131 os << std::endl;
132 }
133
134 /// Constructor for cloning \a s
135 MineSweeper(MineSweeper& s) :

Callers

nothing calls this directly

Calls 3

mineFieldFunction · 0.85
posFunction · 0.70
valMethod · 0.45

Tested by

no test coverage detected