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