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

Method print

examples/knights.cpp:218–237  ·  view source on GitHub ↗

Print board

Source from the content-addressed store, hash-verified

216 }
217 /// Print board
218 virtual void
219 print(std::ostream& os) const {
220 int* jump = new int[n*n];
221 {
222 int j=0;
223 for (int i=0; i<n*n; i++) {
224 jump[j]=i; j=succ[j].min();
225 }
226 }
227 os << "\t";
228 for (int i = 0; i < n; i++) {
229 for (int j = 0; j < n; j++) {
230 os.width(3);
231 os << jump[f(i,j)] << " ";
232 }
233 os << std::endl << "\t";
234 }
235 os << std::endl;
236 delete [] jump;
237 }
238};
239
240/**

Callers

nothing calls this directly

Calls 3

fFunction · 0.85
minMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected