[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

99 bottles

I don't know Python so I can't evaluate (so to speak) this, but I thought
you might find it entertaining.
-- Dan

From: Dave Rolsky <autarch@urth.org>
Date: Tue, 8 Oct 2002 00:56:44 -0500 (CDT)

On Wed, 2 Oct 2002, oxymoron wrote:

 > Here's my minimal Python version:
 > print "".join(map(lambda n,b="\nTake one down, pass it around\n%s 
bottles of "+
 > "beer on the 

Hah, that's not minimal.  That's a whopping 157 characters without line
breaks!  That's positively effusive.

Here's a _real_ minimal version, 139 characters of lovely Perl:

$b=sub{(99_-@_-$_||No)." bottles of beer on the wall\n"};
warn map{&$b.substr(&$b,0,18)."\nTake one down, pass it 

They both handle "no bottles", but they also both blow it with "one
bottles".  Oh well.