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 EDI C

Date:04/20/05
Author:Kurt Svensson
URL:n/a
Comments:0
Info:n/a
Score: (3.02 in 123 votes)
// Author: Kurt Svensson, www.inobiz.se, 2003-05-23
const drinkingtime = -300; // Milliseconds
main()
    {
    for (integer bottles = 99; bottles; )
        {
       println (bottles & txt(bottles) & " of beer on the wall");
       println (bottles-- & txt(bottles) & " of beer.");
       println ("Take one down, pass it around,\r\n");
       sleep (drinkingtime);
       }
    println ("Now they are all gone");
    }

string txt (integer bottles)
    {
    string b = " bottle";
    b &= bottles > 1 ? "s";
    return b;
    }
// end-of-program

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: