Montag, 25. März 2013
ოთხი ორი ერთი
ice.land, 00:34h
def collatz(n)
n % 2 == 0 ? n / 2 : 3 * n + 1
end
puts "Please type in a number"
number = gets.chomp
if number != ""
number = number.to_i
else
number = rand(10**1000)
end
while number > 1
number = collatz(number)
puts "#{number}"
sleep 0.1
end
n % 2 == 0 ? n / 2 : 3 * n + 1
end
puts "Please type in a number"
number = gets.chomp
if number != ""
number = number.to_i
else
number = rand(10**1000)
end
while number > 1
number = collatz(number)
puts "#{number}"
sleep 0.1
end
... comment