From: Sebastian Hungerecker Date: 2008-07-28T15:39:46+09:00 Subject: Re: deaf grandma. houston barnett-gearhart wrote: > is there a string method that enables you to output whatever > grandma is saying as if she is typing it in real time? if so, how can i > implement that in my program? def type(string, speed=5) old_sync = $stdout.sync $stdout.sync = true string.each_char do |c| print c sleep 1.0/speed end $stdout.sync = old_sync end type "foo\nbar\bz" This will type 5 letters per second (the default value for speed), first typing foo, then a newline, then bar and then deleting the r in bar and replacing it with a z. So put this method definition at the beginning of your script and then use type instead of puts. If you're using ruby 1.8.6, you'll also have to require 'jcode' at the top of the file. HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826