i = 0 loop do (3-i.to_s.length).times do print '0' end puts i STDOUT.flush break if gets.chomp == "unlocked" #printf "\e[1A" i += 1 end