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