Tuesday, December 22, 2009

Lotto (Duży Lotek) generator in Ruby

numbers = []
while(numbers.size != 6) do
 x = (rand(49) + 1)
 numbers << x unless numbers.include?(x)
end
numbers.sort!

No comments:

Post a Comment