shuffle

fun <T> Array<T>.shuffle()(source)

Randomly shuffles elements in this array in-place.

Since Kotlin

1.4

fun <T> Array<T>.shuffle(random: Random)(source)

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)(source)

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()(source)

Since Kotlin

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

Randomly shuffles elements in this list.

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

Since Kotlin

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

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()(source)

Randomly shuffles elements in this mutable list.

Since Kotlin

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

Randomly shuffles elements in this list.

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

Since Kotlin

1.3
actual fun <T> MutableList<T>.shuffle()(source)

Randomly shuffles elements in this list.

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

Since Kotlin

1.8
actual fun <T> MutableList<T>.shuffle()(source)

Randomly shuffles elements in this list.

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

Since Kotlin

1.8