#!/usr/bin/ruby # Don't pause on first character e = nil ARGF.each_char{|c| print c # Pause before next character if current character is not part of # an escape sequence, and it's not the start of the next escape sequence. e = e ? (u = c.upcase) < "A" || u > "Z" : c == "\e" ? 1 : begin !sleep 0.1; end }