randomShuffle

Shuffles elements of r using gen as a shuffler. r must be a random-access range with length. If no RNG is specified, rndGen will be used. Returns the newly-shuffled range, and so is composable:

alias randomShuffle = shuffle

Examples

// generates the array [0, 1, ..., 10],
// shuffles it, and writes to console
iota(10).array.shuffle.writeln;

A randomShuffle alias has been provided to ease migration from code written using $(PHOBOSXREF random, randomShuffle).

Meta