Core API – Kotlin Programming Language (original) (raw)

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

fun ByteArray.shuffle()(source)

fun ShortArray.shuffle()(source)

fun IntArray.shuffle()(source)

fun LongArray.shuffle()(source)

fun FloatArray.shuffle()(source)

fun DoubleArray.shuffle()(source)

fun BooleanArray.shuffle()(source)

fun CharArray.shuffle()(source)

@ExperimentalUnsignedTypes

fun UIntArray.shuffle()(source)

@ExperimentalUnsignedTypes

fun ULongArray.shuffle()(source)

@ExperimentalUnsignedTypes

fun UByteArray.shuffle()(source)

@ExperimentalUnsignedTypes

fun UShortArray.shuffle()(source)

Randomly shuffles elements in this array in-place.

Since Kotlin

1.4


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

fun ByteArray.shuffle(random: Random)(source)

fun ShortArray.shuffle(random: Random)(source)

fun IntArray.shuffle(random: Random)(source)

fun LongArray.shuffle(random: Random)(source)

fun FloatArray.shuffle(random: Random)(source)

fun DoubleArray.shuffle(random: Random)(source)

fun BooleanArray.shuffle(random: Random)(source)

fun CharArray.shuffle(random: Random)(source)

@ExperimentalUnsignedTypes

fun UIntArray.shuffle(random: Random)(source)

@ExperimentalUnsignedTypes

fun ULongArray.shuffle(random: Random)(source)

@ExperimentalUnsignedTypes

fun UByteArray.shuffle(random: Random)(source)

@ExperimentalUnsignedTypes

fun UShortArray.shuffle(random: Random)(source)

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

See: A modern version of Fisher-Yates shuffle 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: A modern version of Fisher-Yates shuffle algorithm.

Since Kotlin

1.3


expect fun <T> MutableList<T>.shuffle()(source)

Randomly shuffles elements in this list in-place.

See: A modern version of Fisher-Yates shuffle 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