All pastes #336661 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-02-02 04:51 UTC
rendered paste body
$ cat =typewriter 
#!/usr/bin/ruby
# This is used to print out a thing with a simple typewriter effect
# Made by Sakireth


STDOUT.sync = true

def typewriter (string)
  string.each_line do |line|
    line.strip.split('').each do |char|
      print char
      sleep 0.04
    end
    sleep 0.3
    puts
    sleep 0.2
  end
end

trap(:INT) { puts ; exit }

while input = gets
  typewriter input
end