gistlib
To generate a random number between 1 and 10 in Ruby, you can use the rand method with an argument of 1..10:
rand
main.rbrandom_number = rand(1..10) puts random_number 47 chars3 lines
random_number = rand(1..10) puts random_number
This will output a random integer between 1 and 10 inclusive.
gistlibby LogSnag