\brief Initialize bishops * \relates CrowdedChess */
| 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 |