(apply-shuffle idx coll)
Applies shuffle index to the coll.
A shuffle index of 0 returns the coll unmodified. A shuffle index of total-shuffles - 1 returns the coll reversed.
Applies shuffle index to the coll. A shuffle index of 0 returns the coll unmodified. A shuffle index of total-shuffles - 1 returns the coll reversed.
(random-shuffle-idx items)
(random-shuffle-idx items the-random)
(random-shuffle-idx items)
Returns a random shuffle index for items.
items parameter is either a number of items or a coll of items
the-random argument is an instance of java.util.Random you want to use/reuse, if not provided a new (SecureRandom/getInstanceStrong) will be used, which is rather slow. (8 us per call vs 0.25us per call if you reuse a secure random).
Returned is the sequential number of shuffle. Use the number to shuffle the items.
Returns a random shuffle index for items. items parameter is either a number of items or a coll of items the-random argument is an instance of java.util.Random you want to use/reuse, if not provided a new (SecureRandom/getInstanceStrong) will be used, which is rather slow. (8 us per call vs 0.25us per call if you reuse a secure random). Returned is the sequential number of shuffle. Use the number to shuffle the items.
(total-shuffles items)
Return the total count of different shuffles.
Parameter is either a number of items or a coll of items.
Return the total count of different shuffles. Parameter is either a number of items or a coll of items.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close