Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language zkl

(OO + functional elements)

Date:06/01/11
Author:Craig Durland
URL:http://zenkinetic.com
Comments:0
Info:http://zenkinetic.com/zkl.aspx
Score: (3.50 in 2 votes)
// Matches capitalization of lyrics
// 2 char diff: I end with a blank line, original last line is " Go ..."
[99..0,-1].apply(fcn(n){
   println(beers(n), " the wall, ", beers(n).toLower(), ".\n",
      n==0 and ("Go to the store and buy some more, 99 bottles of beer") or
      ("Take one down and pass it around, " + beers(n-1).toLower()),
      " on the wall.\n")
});
fcn beers(n){
   (n==0 and "No more bottles" or n==1 and "1 bottle" or "" + n + " bottles")
   + " of beer"
}

Download Source | Write Comment

Alternative Versions

Comments

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: