Affichage du tableau Ruby au hasard
arr = [1, 2, 3, 4]
arr.sample # => 3 pick random number
arr.shuffle # => [3, 1, 4, 2]
Lioruby
arr = [1, 2, 3, 4]
arr.sample # => 3 pick random number
arr.shuffle # => [3, 1, 4, 2]
(1..10).to_a
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]