jvm - How can I get a random number in Kotlin? -
a generic method can return random integer between 2 parameters ruby rand(0..n)
generate random integer between from
(inclusive) , to
(exclusive)
import java.util.random val random = random() fun rand(from: int, to: int) : int { return random.nextint(to - from) + }
Comments
Post a Comment