After some further golfing borrowing heavily from Dave and T. Onoma. I have on
your demand line broken versions that you should be able to cut and paste into
irb. For me it does work only in a standard xterm, uxterm is failing because it
does interpret the "°" wrongly. Exchange this against another symbol, e.g. " to
make it work.
regards,
Brian
# Franks Original Version: 186 Bytes
s="\033[2J\033[0;0H _\n Quack! >(')____,\n (`
=~~/\nv^v^v^v^v^`---'v^v^v^v^";(1..(1/0.0)).each{|i|s[23,6]=(i%2)==0?"Quack!":"
"*6;s.tr!('>v^^v<','<^vv^>');puts s;sleep 1}
# Packed (RLE) and enhanced: 203 Bytes
# Remove newlines
s="\e[2J\e[0;0H"+" 30_\n 21Quack! >(*)_4,\n 29(` =~2/\nw15`-3'w15\n
w33\n".gsub(/(.)(\d+)/){$1*$2.to_i}.gsub('w','v^');i=0;loop{s[63,6]=i&1>0?'Qua
ck!':' '*6;s.tr!(t='*.>v^<,°',t.reverse);$><<s;i+=sleep 1}
# Line-Broken Packed (RLE) and enhanced: 203 Bytes
s="\e[2J\e[0;0H"+" 30_\n 21Quack! >(*)_4,\n 29(` =~2/\nw15`-3'w15\n w33
".gsub(/(.)(\d+)/){$1*$2.to_i}.gsub('w','v^');i=0;loop{s[63,6]=i&1>0?
'Quack!':' '*6;s.tr!(t='*.>v^<,°',t.reverse);$><<s;i+=sleep 1}
# Shortened and enhanced: 172 Bytes
# Remove newlines
s="\e[2J\e[0;0H _\nQuack! >(*)____,\n (`
=~~/\n^v^v^v^v^`---'v^v^v^v^\n";i=0;loop{s[21,6]=i&1>0?'Quack!':'
'*6;s.tr!(t='*.>v^<,°',t.reverse);$><<s;i+=sleep 1}
# Line-Broken shortened and enhanced (Attention meaningfull newlines):
# 170 Charakters including Newlines
s="\e[2J\e[0;0H _\nQuack! >(*)____,\n (` =~~/
^v^v^v^v^`---'v^v^v^v^\n";i=0;loop{s[21,6]=i&1>0?'Quack!':' '*6;s.tr!(t=
'*.>v^<,°',t.reverse);$><<s;i+=sleep 1}
# Line-Broken shortened and enhanced (Attention meaningfull newlines):
# 170 Charakters including Newlines
# Works also in a uxterm
s="\e[2J\e[0;0H _\nQuack! >(*)____,\n (` =~~/
^v^v^v^v^`---'v^v^v^v^\n";i=0;loop{s[21,6]=i&1>0?'Quack!':' '*6;s.tr!(t=
'*.>v^<,"',t.reverse);$><<s;i+=sleep 1}
···
On Wed, 8 Dec 2004 12:22:22 +0900 Eirikur Hallgrimsson <eh@mad.scientist.com> wrote:
I am having the worst time getting these cute little things to work.
Pasting into irb is almost working for me. I think it's a problem
with line wrapping inside code which is pretty hard for me to read
to begin with. Is there some way to cast these into a canonical form
that will survive their trip through email and cut and paste?
Eirikur
--
Brian Schröder
http://www.brian-schroeder.de/