On Wednesday 08 December 2004 07:06 am, Brian Schröder wrote:
| 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}

144

q,w='Quack! >','~^'*11;t="\e[2J\e[0;0H         _\n%8s(')____,\n        (` 
=^^/\n%20s \n";i=0;loop{s=t%[i&1>0?q:'<',w[i%2,20]];$><<s;i+=sleep 1}

I left out the eye and tail changing (the eye would be about +3, not sure 
about the tail), they seemed a bit much IMHO. BTW: What happend to the 
feather flapping? Well, I thought that also looked a bit odd so I didn't put 
it back in either. Shorter is sweeter.

T.