| 150 | } |
| 151 | |
| 152 | bool computeDivisor(int x, int &divisor) |
| 153 | { |
| 154 | int upperBound = std::sqrt(x); |
| 155 | for (int i = 2; i <= upperBound; ++i) { |
| 156 | if (x % i == 0) { |
| 157 | divisor = i; |
| 158 | return true; |
| 159 | } |
| 160 | } |
| 161 | return false; |
| 162 | } |
| 163 | |
| 164 | // Compute an X x Y x Z grid to have 'num' grid cells, |
| 165 | // only gives a nice grid for numbers with even factors since |