Duck images

D

Dave Burt

Hi,

Phil Tomson recently suggested developing a duck image to represent ruby
instead of the standard red stone thing.

Nikolai Weibull said this has been proposed before, but copyright
encumbrance has been an issue.

Phil said why the lucky stiff has talent. [ruby-talk:121973]

Why the lucky stiff drew what is apparently The Only Copyrightless Duck In
Recent History:
http://www.whytheluckystiff.net/
An awesome anatid AFAICS.

My ducks are essentially copies of why's.

This is my first small contribution:
http://www.dave.burt.id.au/ruby/duck.ico
(16x16x4bit and 32x32x4bit)

The second is post-scripted as a sig should be.

Cheers,
Dave

_ ___
/ \ / \
\. |: cc|
(.|:,---,
(.|: \ c|
(. y-'
\ _ /
m m
 
T

trans. (T. Onoma)

On Monday 06 December 2004 12:37 am, Dave Burt wrote:
| Hi,
|
| Phil Tomson recently suggested developing a duck image to represent ruby
| instead of the standard red stone thing.

This may help.

http://www.whyaduck.com/index.htm

| Nikolai Weibull said this has been proposed before, but copyright
| encumbrance has been an issue.
|
| Phil said why the lucky stiff has talent. [ruby-talk:121973]
|
| Why the lucky stiff drew what is apparently The Only Copyrightless Duck In
| Recent History:
| http://www.whytheluckystiff.net/
| An awesome anatid AFAICS.
|
| My ducks are essentially copies of why's.
|
| This is my first small contribution:
| http://www.dave.burt.id.au/ruby/duck.ico
| (16x16x4bit and 32x32x4bit)
|
| The second is post-scripted as a sig should be.
|
| Cheers,
| Dave
|
| _ ___
| / \ / \
| \. |: cc|
| (.|:,---,
| (.|: \ c|
| (. y-'
| \ _ /
| m m

That is one messed up rabbit!

In fact, that's *no* sig. This is a sig!


.~NM.
+::O:+
.M::::. ,...
.:::D::MMM::=:MM .
.::M:::~:::~D:=DN:M
..M+:M: +:M:::MM,8:::M?::::,O
.M::::~:$M .::7MMMMM:~:::::M,:Z:,M
.M~:::::8~:M? .:N~DM::::::,:,:=:,,,,,M
.M::::::::::DOM .:M:D=O:,::,,,,:,,,,,,,,,+
.M::::::::::~=D: DM88:8:?:::,,=M,,,,,:,,:,,.
.N::?:::::::=::ND .=M:::$:,::::MMMMM,,MMM,,,,.
.D=::+::::::+?8:M .=.M~:8IN:::,:M,MMM,,MMMM,,,.
..M::?~~::::::~?M 8.M+NMN::::,M::~MM,,,,MM,,D.
..MM::::::OD:D .MD~~M:::::=MMMM,,,MMM,,,I
MO:::::7+$~ .ZOZ~::::::,7::,,,,,MM,,M .MM.
.:8::::::$Z~ .~::~::::::::::,,,,,,,,: .M:?:,Z,,.
~:M::::::$~~ 8~:~8:::::::::MM~M::=:?+7I,::MMMD,M.
:I$~::::~D:. ~~O:M8:,::::$,?MM:,::,,ND:::MMM=~,,.
.M:~:$::::?: .M$Z8N::::::::::M::::::::=,,MMMN=Z,,.
.DN:~:::~:~. .M8~N$:7:::::,M~N::::::?::,MMMDO?M,,.
.M$:::~:, .M8:::::=:,:::,,+::::::::,~MMD~8N=,?
.~:::~~M? .II?:D::::::::,::M::::::M:MMM,MN?,,M
.=:N::~:?: $:IMM?M:~,:~:+::,:M::::::,MMD+888,,.
M:Z~?~::~, MDMI~:8~:::::~:,,:: .~:,:MMMNMOM~,M
M:N:~:::I. .::?:N8:~88:~~::,,:M .:,:MMMMM,M,$.
.:$~:::?~ .M::$Z:~~:::D~=::::,M .I:,MMMMMM,
..M~:::M:M.M:M:OO8=::::~:M,::::7 M,,,7ZN,M.
...:~NO~$:8~:::~$=~~:~::::::. M,,,7.
M:::::8=8:~::::::~~::::::+.
.I:I~~::::=:::::::D:::::::M
.=~MNI:~:~:::Z:I:?:::::::D.
M:~::~:Z::~+:::O=::::::Z.
N:7:8Z$:~~~~:8~:+::::~M
M:::I:::+:::::?:::::M
.$N~=~:I:?N:::::::~N8.
.M~~MZ~:~=::OM=~:~M:~M
.OD~~~:~NMMO+?MM=:::::M
M~::~~~~ +M::,:.M .
.DDN.,MM .M?M.M
. . . .


GlassGiant.com

Now that's a duck! Can we call him Type?

:) Do you Ruby?
 
D

Dave Burt

#!/usr/local/bin/ruby
# Copyright (c) 2000 Brian Fundakowski Feldman
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Id: img2ascii.rb,v 1.5 2000/11/01 06:06:14 green Exp green $
#
# Convert an image into greyscale ASCII art.
#
# usage: img2ascii.rb [-hr] [-w width] [-a aspect] file

require 'GD'
require 'getopts'

scrnwidth = 80
aspect_ratio = 6.0 / 10.0

def usage(string = nil)
puts "error: " + string if string
$stderr.puts "usage: #{$0} [-hr] [-w width] [-a aspect] file"
exit 1
end

usage("invalid option") if !getopts("hr", "a:", "w:")
if $OPT_w
scrnwidth = $OPT_w.to_i
if scrnwidth <= 1
usage("bad width")
end
end
if $OPT_a
$OPT_a.gsub(/[[:space:]]/, '') =~
/^([[:digit:]]+\.?[[:digit:]]*?)(\/([[:digit:]]+\.?[[:digit:]]*))?$/
usage("bad number") if !$1 || $1.to_f == 0.0 || ($3 && $3.to_f == 0.0)
aspect_ratio = $3 ? ($1.to_f / $3.to_f) : $1.to_f
usage("negative ratio") if aspect_ratio == 0.0
end

usage("no file name") if !(name = ARGV.shift)
case name
when /\.jpe?g$/i
img = GD::Image.newFromJpeg(open(name, 'r'))
when /\.png$/i
img = GD::Image.newFromPng(open(name, 'r'))
when /\.xbm$/i
img = GD::Image.newFromXbm(open(name, 'r'))
when /\.xpm$/i
img = GD::Image.newFromXpm(open(name, 'r'))
else
usage("invalid file name")
end

gradient =
' .\'`,^:";~-_+<>i!lI?/\|()1{}[]rcvunxzjftLCJUYXZO0Qoahkbdpqwm*WMB8&%$#@'
gradient.reverse! if !$OPT_r
width, height = img.bounds
nwidth = [width, scrnwidth].min
# useful ratios
# xterm: 6x13, netscape <pre>: 6x10
nheight = (height.to_f * aspect_ratio * (nwidth.to_f / width.to_f)).to_i
usage("width too small") if nwidth <= 0
usage("height too small") if nheight <= 0

$stderr.printf("%s: %d x %d, %d colors -> %d x %d\n", name, width, height,
img.colorsTotal, nwidth, nheight)

nimg = GD::Image.new(nwidth, nheight)
img.copyResized(nimg, 0, 0, 0, 0, nwidth, nheight, width, height)

if $OPT_h
filters = [[/[[:space:]]*$/, ''], [/&/, '&amp;'], [/</, '&lt;'],
[/>/, '&gt;'], [/\[/, '['], [/\]/, '&#93']]
else
filters = [[/[[:space:]]*$/, '']]
end

(0...nheight).each {|h|
line = (0...nwidth).collect {|w|
pixcolor = nimg.getPixel(w, h)
colors = nimg.red(pixcolor) + nimg.green(pixcolor) + nimg.blue(pixcolor)
gradient[((colors.to_f / 765.1) * gradient.size).floor, 1]
}.join
filters.each {|*r| line.gsub!(r[0], r[1])}
puts line
}
 
D

Dave Burt

OK, here's another ASCII-style Ruby Duck (Type), this time using Jave (it's
really good!)

,_"oY/..
d/ d,`.|
Y' ' _, ...__
|. Y\/o/P\d|'Y8`Y\\._
'`'.PPPYY ''==oo ,.. '\\_
,_.Y-Yb\. | /\`"-Ybd`." --`YY. .| "\.
_,/"' `.\Y\ .',8Y\o-Y88''' ''-Y.--=. `.
,P"' '\P\\O| ,',8/ //' ``'' ' `\
,/ 'Y '\8 ,b'8``'b.' |.
../ \| | /'P.\ `/O' ,,/+-. ,__ ||
/ . \' \|\ `| '|'\ \/ /8888\. ,d88| |
\ \.-' / 'b|. /||'.',P / .Y/8|\8| .88P88 ,|
`o_'`',,_. | \`| |Y/||b_8YY |''''/8| |'Y'88| |'
'YP.._` | //,| 8|Y/P\' |bob888' |ob88" ./
./` \|,/| ||o|| | \8/P' `8 _ /' ___
/'`` ' '|| ||/|\/| '""" '' /' _,Y-'','"\.
| ' ' |\ ||//.V' _,.ooo-----/\-"'d _/ob. \.
'|,P' . |Y|8 ||| |8, ,Y 88b8' ' _ `' ,/88888|'|
\.'\/ . |\|8 | |`|| ' `/'Y88' `'/ ,8888//8| \
\_ '"., '/|| / b | ,,d\/ ,888888 P /
`"P._ |/ 8| /,. '' || .8888YY8\| |
,/' | P8 ||/| \ ' \. /888P8PP'' ||
,'._. | \| ||||// ' . `\. ` |8888YP'`` |'
// Y. \/ | 8,||||\\. . '\P. /888888/d' ,/
|' ' |' ||b| |/| ||\\Y'`.. /''\. 88888888\|./
\||`-' '|88 ,8` / ||| ' ,| `.' 88888888`,/'
\.-,\_/ |/| /'\\ \P/. ' || `. 'P8888'",/
'"P.___., /o_/'\|O8 ""\_ ' '' _| `\_ '`/P`_/
''8 "\o ,| Vd' '` ` / 'Y....''
|| ''\\^d' ,|
\ , , '`'' ||
\|'\P.. ' ' ` 8
`\ '.. ' |. ` |/
`\ /'`,` ' '' _ . ,' ,8'
`\. ' ' . /'
'8\_' ` /. ,/8.
||.'\\.. _. / .Y'. _/P''\.
\. '""-P...___o.//"' '\.
`\. || '\`_ ,Pd|
'.'.., ,-/ \.P,/d8'
\' `/ 'P' '
 
P

Phil Tomson

Hi,

Phil Tomson recently suggested developing a duck image to represent ruby
instead of the standard red stone thing.

Well, or maybe in addition to the red stone thing... a duck to represent
duck typing.
Nikolai Weibull said this has been proposed before, but copyright
encumbrance has been an issue.

Phil said why the lucky stiff has talent. [ruby-talk:121973]

Why the lucky stiff drew what is apparently The Only Copyrightless Duck In
Recent History:
http://www.whytheluckystiff.net/
An awesome anatid AFAICS.

What is that fox (I'm assuming that's a fox) on the back of the duck
represent? Is he whispering in the duck's ear? I just get the feeling
that the fox (if it is a fox) has some deep psychological meaning perhaps
representing the duck's deap-seated, primordial fear of foxes. Perhaps
it is the Fox of static typing? (appologies, Why, if it's not a fox)
My ducks are essentially copies of why's.

This is my first small contribution:
http://www.dave.burt.id.au/ruby/duck.ico
(16x16x4bit and 32x32x4bit)

The second is post-scripted as a sig should be.

Cheers,
Dave

_ ___
/ \ / \
\. |: cc|
(.|:,---,
(.|: \ c|
(. y-'
\ _ /
m m

I dunno. Looking at this ASCII version, I see a squirrel.

Phil
 
P

Phil Tomson

OK, here's another ASCII-style Ruby Duck (Type), this time using Jave (it's
really good!)

,_"oY/..
d/ d,`.|
Y' ' _, ...__
|. Y\/o/P\d|'Y8`Y\\._
'`'.PPPYY ''==oo ,.. '\\_
,_.Y-Yb\. | /\`"-Ybd`." --`YY. .| "\.
_,/"' `.\Y\ .',8Y\o-Y88''' ''-Y.--=. `.
,P"' '\P\\O| ,',8/ //' ``'' ' `\
,/ 'Y '\8 ,b'8``'b.' |.
./ \| | /'P.\ `/O' ,,/+-. ,__ ||
/ . \' \|\ `| '|'\ \/ /8888\. ,d88| |
\ \.-' / 'b|. /||'.',P / .Y/8|\8| .88P88 ,|
`o_'`',,_. | \`| |Y/||b_8YY |''''/8| |'Y'88| |'
'YP.._` | //,| 8|Y/P\' |bob888' |ob88" ./
./` \|,/| ||o|| | \8/P' `8 _ /' ___
/'`` ' '|| ||/|\/| '""" '' /' _,Y-'','"\.
| ' ' |\ ||//.V' _,.ooo-----/\-"'d _/ob. \.
'|,P' . |Y|8 ||| |8, ,Y 88b8' ' _ `' ,/88888|'|
\.'\/ . |\|8 | |`|| ' `/'Y88' `'/ ,8888//8| \
\_ '"., '/|| / b | ,,d\/ ,888888 P /
`"P._ |/ 8| /,. '' || .8888YY8\| |
,/' | P8 ||/| \ ' \. /888P8PP'' ||
,'._. | \| ||||// ' . `\. ` |8888YP'`` |'
// Y. \/ | 8,||||\\. . '\P. /888888/d' ,/
|' ' |' ||b| |/| ||\\Y'`.. /''\. 88888888\|./
\||`-' '|88 ,8` / ||| ' ,| `.' 88888888`,/'
\.-,\_/ |/| /'\\ \P/. ' || `. 'P8888'",/
'"P.___., /o_/'\|O8 ""\_ ' '' _| `\_ '`/P`_/
''8 "\o ,| Vd' '` ` / 'Y....''
|| ''\\^d' ,|
\ , , '`'' ||
\|'\P.. ' ' ` 8
`\ '.. ' |. ` |/
`\ /'`,` ' '' _ . ,' ,8'
`\. ' ' . /'
'8\_' ` /. ,/8.
||.'\\.. _. / .Y'. _/P''\.
\. '""-P...___o.//"' '\.
`\. || '\`_ ,Pd|
'.'.., ,-/ \.P,/d8'
\' `/ 'P' '

This is the one we should dig up whenever anyone posts something about
adding static typing to Ruby. ;-)

Phil
 
W

why the lucky stiff

Phil said:
What is that fox (I'm assuming that's a fox) on the back of the duck
represent? Is he whispering in the duck's ear? I just get the feeling
that the fox (if it is a fox) has some deep psychological meaning perhaps
representing the duck's deap-seated, primordial fear of foxes. Perhaps
it is the Fox of static typing? (appologies, Why, if it's not a fox)
It's an upright horse. His name is Audie the Upright Horse. He's the
duck's owner. And, yes, of course he has deep psychological meaning
that ranges from a harsh criticism of existensialism to my own childhood
fear of broken calculators. It's all there.

But, Great Coats! That huge ascii duck is marvellous. You done it
well, Dave Burt.

_why
 
T

trans. (T. Onoma)

Cool! Did you submit to the contest?

On Monday 06 December 2004 06:17 am, Dave Burt wrote:
| #!/usr/local/bin/ruby
| # Copyright (c) 2000 Brian Fundakowski Feldman
| # All rights reserved.
| #
| # Redistribution and use in source and binary forms, with or without
| # modification, are permitted provided that the following conditions
| # are met:
| # 1. Redistributions of source code must retain the above copyright
| # notice, this list of conditions and the following disclaimer.
| # 2. Redistributions in binary form must reproduce the above copyright
| # notice, this list of conditions and the following disclaimer in the
| # documentation and/or other materials provided with the distribution.
| #
| # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
| # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
| # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
| PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
| LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
| CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
| SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
| INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
| CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
| ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
| THE POSSIBILITY OF # SUCH DAMAGE.
| #
| # $Id: img2ascii.rb,v 1.5 2000/11/01 06:06:14 green Exp green $
| #
| # Convert an image into greyscale ASCII art.
| #
| # usage: img2ascii.rb [-hr] [-w width] [-a aspect] file
|
| require 'GD'
| require 'getopts'
|
| scrnwidth = 80
| aspect_ratio = 6.0 / 10.0
|
| def usage(string = nil)
| puts "error: " + string if string
| $stderr.puts "usage: #{$0} [-hr] [-w width] [-a aspect] file"
| exit 1
| end
|
| usage("invalid option") if !getopts("hr", "a:", "w:")
| if $OPT_w
| scrnwidth = $OPT_w.to_i
| if scrnwidth <= 1
| usage("bad width")
| end
| end
| if $OPT_a
| $OPT_a.gsub(/[[:space:]]/, '') =~
| /^([[:digit:]]+\.?[[:digit:]]*?)(\/([[:digit:]]+\.?[[:digit:]]*))?$/
| usage("bad number") if !$1 || $1.to_f == 0.0 || ($3 && $3.to_f == 0.0)
| aspect_ratio = $3 ? ($1.to_f / $3.to_f) : $1.to_f
| usage("negative ratio") if aspect_ratio == 0.0
| end
|
| usage("no file name") if !(name = ARGV.shift)
| case name
| when /\.jpe?g$/i
| img = GD::Image.newFromJpeg(open(name, 'r'))
| when /\.png$/i
| img = GD::Image.newFromPng(open(name, 'r'))
| when /\.xbm$/i
| img = GD::Image.newFromXbm(open(name, 'r'))
| when /\.xpm$/i
| img = GD::Image.newFromXpm(open(name, 'r'))
| else
| usage("invalid file name")
| end
|
| gradient =
| ' .\'`,^:";~-_+<>i!lI?/\|()1{}[]rcvunxzjftLCJUYXZO0Qoahkbdpqwm*WMB8&%$#@'
| gradient.reverse! if !$OPT_r
| width, height = img.bounds
| nwidth = [width, scrnwidth].min
| # useful ratios
| # xterm: 6x13, netscape <pre>: 6x10
| nheight = (height.to_f * aspect_ratio * (nwidth.to_f / width.to_f)).to_i
| usage("width too small") if nwidth <= 0
| usage("height too small") if nheight <= 0
|
| $stderr.printf("%s: %d x %d, %d colors -> %d x %d\n", name, width, height,
| img.colorsTotal, nwidth, nheight)
|
| nimg = GD::Image.new(nwidth, nheight)
| img.copyResized(nimg, 0, 0, 0, 0, nwidth, nheight, width, height)
|
| if $OPT_h
| filters = [[/[[:space:]]*$/, ''], [/&/, '&amp;'], [/</, '&lt;'],
| [/>/, '&gt;'], [/\[/, '['], [/\]/, '&#93']]
| else
| filters = [[/[[:space:]]*$/, '']]
| end
|
| (0...nheight).each {|h|
| line = (0...nwidth).collect {|w|
| pixcolor = nimg.getPixel(w, h)
| colors = nimg.red(pixcolor) + nimg.green(pixcolor) + nimg.blue(pixcolor)
| gradient[((colors.to_f / 765.1) * gradient.size).floor, 1]
| }.join
| filters.each {|*r| line.gsub!(r[0], r[1])}
| puts line
| }
 
T

trans. (T. Onoma)

On Monday 06 December 2004 12:52 pm, Phil Tomson wrote:
| > _   ___
| >/ \ /   \
| >\. |: cc|
| > (.|:,---,
| > (.|: \ c|
| > (.    y-'
| >  \ _ /
| >   m m
|
| I dunno. Looking at this ASCII version, I see a squirrel.

Which is why is so perfect for representing duck typing. Is it a squirrel? Is
it a rabbit? No! Its Type, the shape-shifting duck!

What a master of disguise! Check him out with his bifocals on:

/ \ /   \
\. |:-OO-|
(.|:,---,
(.|: \ c|
(.    y-'
 \ _ /
  m m

T.
 
M

Michael DeHaan

YES! Anyone want to golf the duck down further? On second
thought, golf should never be played with ducks, it's too cruel.
Canada geese maybe :)
 
W

why the lucky stiff

gabriele said:
pat eyler ha scritto:


people, I love this place.
I'm amazed at the progress that has been made in just the last 12
hours. If you'd like to start using any of these ducks, in the form of
a one-line signature, here's a DRb line:

ruby -rdrb -e
'DRb.start_service;duck=DRbObject.new(nil,"druby://whytheluckystiff.net:6503");puts
duck.daves'

Several other ducks are available at this service, try "puts duck.toms"
or "puts duck.on_the_water". For a complete list: "puts duck.list".

Think of it. In time, we could amass ducks to use them as currency on
the global markets. I think we can take Switzerland.

_why
 
P

pat eyler

Think of it. In time, we could amass ducks to use them as currency on
the global markets. I think we can take Switzerland.

Don't be silly! Who would want to use ducks to take Switzerland ...
we should obviously be targeting Freedonia.

-pate
 
F

Florian Frank

--------------090903090904040200040707
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Michael DeHaan wrote:
[...]

I got an idea...

--
Florian Frank


--------------090903090904040200040707
Content-Type: text/plain;
name="duck.rb"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="duck.rb"

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}

--------------090903090904040200040707--
 
B

Brian Schröder

Michael DeHaan wrote:
[...]

I got an idea...

I took this to play a bit with golfing and here are my first ever golfs:

# 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}

# Shortened and enhanced: 178 Bytes
s="\e[2J\e[0;0H _\n Quack! >(*)____,\n (`
=~~/\nv^v^v^v^v^`---'v^v^v^v^";i=0;loop{s[23,6]=(i+=1)%2==0?'Quack!':'
'*6;s.tr!(t="*.>v^<,°",t.reverse);puts s;sleep 1}

# Packed (RLE): 205 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)%2==0?
'Quack!':' '*6;s.tr!(t="*.>v^<,°",t.reverse);puts s;sleep 1}

I enhanced the original version to waggle with the tail and blinker with the
eyes. I could shorten the original by immense 8 bytes. I then tried to rle
encode the string, but this resulted only in obfuscation, not in improved
shortness. But in the rle compressed version I could expand the Type's world
immensely without a lot of size penalty. So now Type has a big and even nearly
two dimensional sea to swim while paying only 19 additional bytes.

So it should be clear why type waggles it tail ;)

cheers,

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top