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 Inger

Date:04/20/05
Author:Alex van Oostenrijk
URL:n/a
Comments:0
Info:http://inger.sourceforge.net
Score: (2.94 in 16 votes)
/*
 * 99 bottles of beer in Inger
 * (http://inger.sourceforge.net)
 *
 * by Alex van Oostenrijk: atrox [@] zebra [.] uem [.] mz
 *
 */

module bottles;

#include "stdio.ih"

void say: int bottles -> void
{
    switch( bottles )
    {
        case 0
        {
            printf( "No more bottles" );
        }
        case 1
        {
            printf( "One bottle" );
        }
        default
        {
            printf( bottles ); 
            printf( "bottles" );
        }
    }
}
  
start beer: void -> void 
{
    int bottles = 99;

    while( bottles > 0 ) do
    {
        say( bottles );
        printf( " of beer on the wall,\n" );
        say( bottles );
        printf( " of beeeeer . . .,\n" );
        printf( "Take one down, pass it around,\n" );
        bottles = bottles - 1;
        say( bottles );
        printf( " of beer on the wall,\n" );
        say( bottles );
        printf( " of beeeeer . . .,\n\n" );
    }

    printf( "\nTime to buy more beer!\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: