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

Function init_bishops

examples/crowded-chess.cpp:103–119  ·  view source on GitHub ↗

\brief Initialize bishops * \relates CrowdedChess */

Source from the content-addressed store, hash-verified

101 * \relates CrowdedChess
102 */
103 void init_bishops(int size) {
104 Bishops* prob = new Bishops(size);
105 DFS<Bishops> e(prob);
106 IntArgs ia(size*size);
107 delete prob;
108
109 bishops.init(size*size);
110
111 while (Bishops* s = e.next()) {
112 for (int i = size*size; i--; )
113 ia[i] = s->k[i].val();
114 bishops.add(ia);
115 delete s;
116 }
117
118 bishops.finalize();
119 }
120}
121/**
122 \brief %Example: Crowded chessboard

Callers 1

mainFunction · 0.85

Calls 5

initMethod · 0.45
nextMethod · 0.45
valMethod · 0.45
addMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected