fun Random.nextInt(range: IntRange): Int
Gets the next random Int from the random number generator in the specified range.
Int
Generates an Int random value uniformly distributed in the specified range: from range.start inclusive to range.endInclusive inclusive.
range.start
range.endInclusive
IllegalArgumentException - if range is empty.
IllegalArgumentException
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributorsLicensed under the Apache License, Version 2.0. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.random/next-int.html