envzn
0.8 · beta · not released

Library / System / Randomness / Shuffleable

INTERFACE

Shuffleable

The interface a shuffleable collection implements. shuffle(rng) reorders the collection in place into a uniformly-random permutation, drawing index choices from the supplied Shuffler. Array[T] implements it (Fisher-Yates); any future ordered collection can too.

Methods 1

MODIFY METHOD shuffle(MUTABLE REFERENCE Shuffler rng) RETURNS void
modifies

Reorder in place into a uniformly-random permutation, drawing from rng. MODIFY — mutates the collection; rng is a MUTABLE REFERENCE because every draw advances its state.