Generate a random number from a range inclusive

suggest change
# Ruby 1.9.2 and later
lower_limit = 1
upper_limit = 6
Random.new.rand(lower_limit..upper_limit) # .. includes both ends; ... excludes upper_limit

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents