I have two counters with simple animations that put numbers under each other. How to make them all built-in with the same functionality? Thanks for watching!
1000.times do
puts "Press Enter"
gets
x = rand (0..5)
y = rand (0..5)
10.times do |xx|
meter = rand (0..5)
if xx < 9
print meter
print "\r"
sleep 0.08
else print x
end
end
puts
10.times do |yy|
meter = rand (0..5)
if yy < 9
print meter
print "\r"
sleep 0.08
else print y
end
end
puts
end
source
share