final case
A random number between zero (inclusive) and a given hi
boundary (exclusive).
hi
may be negative, but it must not be zero.
This is both an expression and an action. The action draws a new random number, the expression reports the last drawn value.
Example:
val gen = Random()
val r100 = gen.until(100)
Act(
r100, // draw new number
PrintLn("Random number: " ++ r100.toStr) // print current value
)
- Companion
- object