generate random number array ruby code example
Example 1: ruby generate random number
rand()#that will give you a random float between 0 and 10
rand(num)#that will give you a random integer between 0 and the number num
rand(first...second)#that will give you a random
#integer between first and second
Example 2: ruby randomize array
[1,2,3,4].shuffle => [2, 1, 3, 4]
[1,2,3,4].shuffle => [1, 3, 2, 4]