shuffle

fun <T> Array<T>.shuffle()
fun ByteArray.shuffle()
fun ShortArray.shuffle()
fun IntArray.shuffle()
fun LongArray.shuffle()
fun FloatArray.shuffle()
fun DoubleArray.shuffle()
fun BooleanArray.shuffle()
fun CharArray.shuffle()
fun UIntArray.shuffle()
fun ULongArray.shuffle()
fun UByteArray.shuffle()
fun UShortArray.shuffle()

Randomly shuffles elements in this array in-place.

Since Kotlin

1.4

fun <T> Array<T>.shuffle(random: Random)
fun ByteArray.shuffle(random: Random)
fun ShortArray.shuffle(random: Random)
fun IntArray.shuffle(random: Random)
fun LongArray.shuffle(random: Random)
fun FloatArray.shuffle(random: Random)
fun DoubleArray.shuffle(random: Random)
fun BooleanArray.shuffle(random: Random)
fun CharArray.shuffle(random: Random)
fun UIntArray.shuffle(random: Random)
fun ULongArray.shuffle(random: Random)
fun UByteArray.shuffle(random: Random)
fun UShortArray.shuffle(random: Random)

Randomly shuffles elements in this array in-place using the specified random instance as the source of randomness.

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

Since Kotlin

1.4

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

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

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

Since Kotlin

1.3

expect fun <T> MutableList<T>.shuffle()
inline fun <T> MutableList<T>.shuffle(random: Random)

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

Since Kotlin

1.2

actual inline fun <T> MutableList<T>.shuffle()

Randomly shuffles elements in this mutable list.

Since Kotlin

1.2
actual fun <T> MutableList<T>.shuffle()

Randomly shuffles elements in this list.

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

Since Kotlin

1.2
actual fun <T> MutableList<T>.shuffle()

Randomly shuffles elements in this list.

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

Since Kotlin

1.2