import scala.util.Random Random.between(20, 30) // in [20, 30[
val r = scala.util.Random r.nextInt() //no max limit r.nextInt(100) //max limit