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