shuffle

Common
JVM
JS
Native
1.2
fun <T> MutableList<T>.shuffle()
For JVM

Randomly shuffles elements in this mutable list.

For JS, Native

Randomly shuffles elements in this list.

See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm

Common
JVM
JS
Native
1.3
fun <T> MutableList<T>.shuffle(random: Random)

Randomly shuffles elements in this mutable list using the specified random instance as the source of randomness.

See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm

JVM
1.2
fun <T> MutableList<T>.shuffle(random: Random)

Randomly shuffles elements in this mutable list using the specified random instance as the source of randomness.