From: "trans. (T. Onoma)" Date: 2004-12-08T17:49:36+09:00 Subject: Re: Duck images On Wednesday 08 December 2004 02:52 am, Dave Burt wrote: | "Eirikur Hallgrimsson" wrote in message | news:1102475987.9285.5.camel@sal... | | >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 | > | > # Franks original Version: 186 Bytes | > # Shortened and enhanced: 178 Bytes | | The problem is indeed line-wrapping. All the duck sigs posted to date have | been one-liners. The lines probably broke on a single space. Check out the | attachment to Florian's original duck sig post, duck.rb - that should | arrive intact. | | Now, I've done some golfing myself - 145 characters (delete the newlines): | | i=1;loop{w=i&1==1?'v^':'^v';$><<"\e[2J\e[0;0H#{' '*10}_\n #{ | i&1==1?' '*7+'<':'Quack! >'}(*)____,\n#{' '*9}(` =~~/\n#{w*5 | }`---'#{w*4}";i+=sleep 1} | | If that doesn't work: | http://www.dave.burt.id.au/ruby/duck_golf.rb | | 3 more characters, and it'll fit on 2 72-char lines. Who's teeing off next? 142 i=1;loop{w='v^v'[i%2,2];$><<"\e[2J\e[0;0H#{' '*10}_\n #{i&1==1?' '*7+'<':'Quack! >'}(*)____,\n#{' '*9}(`=~~/\n#{w*5}`---'#{w*4}\n";i+=sleep 1} I had to add \n at the end to get the water to appear :(. T.