snippet: rand numbers in ruby function