Generate a random whole number between two points inclusively
rrand_i min (number), max (number)
Given two numbers, this produces a whole number between the min and max you supplied inclusively. Both min and max need to be supplied. For random floats, see rrand
Introduced in v2.0
Examples
| # Example 1 |
|
print rrand_i(0, 10)
|
#=> will print a random number between 0 and 10 (e.g. 4, 0 or 10) to the output pane
|
| # Example 2 |
|
loop do
play rrand_i(60, 72)
sleep 0.125
end
|
#=> Will play a random midi note between C4 (60) and C5 (72)
|