Generate a random whole number below a value (exclusive)
rand_i
[max (number_or_range)]
Given a max number, produces a whole number between 0 and the supplied max value exclusively. If max is a range produces a int within the range. With no args or max as 0 returns either 0 or 1
Introduced in v2.0
|
print rand_i(5) |
#=> will print a either 0, 1, 2, 3, or 4 to the output pane |