randomize the given list of numbers 0 <= i < count */
| 296 | |
| 297 | /* randomize the given list of numbers 0 <= i < count */ |
| 298 | void |
| 299 | shuffle_int_array(int *indices, int count) |
| 300 | { |
| 301 | int i, iswap, temp; |
| 302 | |
| 303 | for (i = count - 1; i > 0; i--) { |
| 304 | if ((iswap = rn2(i + 1)) == i) |
| 305 | continue; |
| 306 | temp = indices[i]; |
| 307 | indices[i] = indices[iswap]; |
| 308 | indices[iswap] = temp; |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | /*rnd.c*/ |
no test coverage detected