Aregev2
07/19/2018, 1:11 PMfun main(args: Array<String>) {
val ls = listOf(12, 23, 435).shuffled()
println(ls[0])
}
I have been using this code, and got that output
Uncaught exception from Kotlin's main: kotlin.IndexOutOfBoundsException
at kfun:kotlin.Exception.<init>()kotlin.Exception (0x4068b2)
at kfun:kotlin.RuntimeException.<init>()kotlin.RuntimeException (0x4067e2)
at kfun:kotlin.IndexOutOfBoundsException.<init>()kotlin.IndexOutOfBoundsException (0x406762)
at kfun:kotlin.collections.ArrayList.checkIndex#internal (0x40de44)
at kfun:kotlin.collections.ArrayList.get(<http://kotlin.Int|kotlin.Int>)#GENERIC (0x40feb7)
at kfun:kotlin.collections.shuffle@kotlin.collections.MutableList<#GENERIC>.()Generic (0x41b89f)
at kfun:kotlin.collections.shuffled@kotlin.collections.Iterable<#GENERIC>.()Generic (0x41c109)
at kfun:main(kotlin.Array<kotlin.String>) (0x403e85)
at EntryPointSelector (0x403d06)
at Konan_start (0x403c77)
at Konan_run_start (0x403bf2)
at Konan_main (0x403b67)
at __libc_start_main (0x7f57da6f0b97)
at (0x403a0a)
at ((nil))
Alexey Belkov [JB]
07/19/2018, 1:14 PMAregev2
07/19/2018, 1:17 PMAregev2
07/19/2018, 1:17 PMfun main(args: Array<String>) {
val ls = mutableListOf(12, 23, 435).shuffled()
println(ls[0])
}
Alexey Belkov [JB]
07/19/2018, 1:19 PMAregev2
07/19/2018, 1:20 PMAlexey Belkov [JB]
07/19/2018, 1:22 PMAregev2
07/19/2018, 1:22 PMPavel Punegov [JB]
07/30/2018, 9:24 PMAregev2
07/31/2018, 4:08 AM