Jonathan Richards writes:
> On Tuesday 09 Dec 2003 9:37 pm, Norman Vine wrote:
> > http://perthon.sourceforge.net/
> >
> > :-)
>
> Interesting - I don't often see two (purportedly) equivalent pieces of code
> together like that. I put both examples into files: the python is 668 bytes,
> whereas the perl is 1074. Is python really that much more terse than perl,
> or is it an artefact of the translation? I have a mildly pathological
> attraction to terse languages; I learned APL *many* years ago, and I have
> been known to do real-world (if not terribly professional) stuff with Icon:
> http://www.cs.arizona.edu/icon/
There's a better way to compare languages:
http://99-bottles-of-beer.ls-la.net/history-and-background.html
Minimal perl By Dave Rolsky (140 Bytes):
$b=sub{([EMAIL PROTECTED]||No)." bottles of beer on the wall\n"};
warn map{&$b.substr(&$b,0,18)."\nTake one down, pass it around\n".&$b(0).$/}0..98
Minimal python By Oliver Xymoron (133 Bytes):
a,t="\n%s bottles of beer on the wall","\nTake one down, pass it around"
for d in range(99,0,-1):print(a%d*2)[:-12]+t+a%(d-1 or'No')
Icon version by Scott E Gilbert <[EMAIL PROTECTED]>:
procedure main()
t:= table("bottles")
t[1]:= "bottle"
every n:= 100 to 1 by -1 do {
write(n, " ", t[n], " of beer on the wall.\n",
n, " ", t[n], " of beer.\n",
"Take one down, Pass it around.\n",
n-1, " ", t[n-1], " of beer on the wall.\n"
)
}
end
Regards,
Curt.
--
Curtis Olson HumanFIRST Program FlightGear Project
Twin Cities curt 'at' me.umn.edu curt 'at' flightgear.org
Minnesota http://www.flightgear.org/~curt http://www.flightgear.org
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel