10000.times.map do puts "%03d" % rand(1000) $>.flush break if gets[0] == "u" end