numbers = [] while(numbers.size != 6) do x = (rand(49) + 1) numbers << x unless numbers.include?(x) end numbers.sort!
Tuesday, December 22, 2009
Lotto (Duży Lotek) generator in Ruby
Simple password generator in Ruby
The code is so simple that it needs no description:
(100000000000 + rand * 1000000000000).to_i.to_s(36)
Subscribe to:
Posts (Atom)