W3cubDocs

/Kotlin

shuffled

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
fun <T> Iterable<T>.shuffled(random: Random): List<T>
Platform and version requirements: JVM (1.2)
fun <T> Iterable<T>.shuffled(random: Random): List<T>

Returns a new list with the elements of this list randomly shuffled using the specified random instance as the source of randomness.

Platform and version requirements: JVM (1.2), JS (1.2), Native (1.2)
fun <T> Iterable<T>.shuffled(): List<T>

Returns a new list with the elements of this list randomly shuffled.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/shuffled.html