array with elements to shuffle
returns the new index for the array element whose index is currently i. i is guaranteed to be in the range [1 .. array.length - 1]; the returned index should be in the range [0 .. i] and must be in range [0 .. array.length - 1].
shuffled array
int[] arr = [ 1, 2, 3, 4 ]; int[] orig = arr.dup; auto modified = shuffle(arr, (size_t i) { return i; }); test!("==")(modified, orig);
Shuffles the elements of array in-place.