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 Neko

Date:01/13/06
Author:Daniel Bainton
URL:n/a
Comments:0
Info:http://nekovm.org
Score: (2.58 in 12 votes)
// Neko version of 99 bottles of beer on the wall
// Created by Daniel Bainton at Friday the 13th, January 2006.

var bottles_left = function(bottles) {
  if (bottles > 1)
    return bottles + " bottles";
  if (bottles == 1)
    return bottles + " bottle";
  if (bottles == 0)
    return "no more bottles";
}

var sing = function(bottles) {
  $print(bottles_left(bottles) + " of beer on the wall, " + bottles_left(bottles) + " of beer.\n");
  $print("Take one down and pass it around, " + bottles_left(bottles - 1) + " of beer on the
wall.\n\n");
}

var bottles = 99;

while (bottles > 0) {
  sing(bottles);
  bottles = bottles - 1;
}

$print("No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.\n");

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: