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 Oberon

(stanard version)

Date:04/20/05
Author:Andrejs Jansons
URL:n/a
Comments:0
Info:n/a
Score: (3.84 in 122 votes)
MODULE BottlesOfBeers; (* Andrejs Jansons 27.10.95 *)

      IMPORT Out;

      PROCEDURE Start*;
           VAR
                bottles: INTEGER;
           BEGIN
                bottles := 99;

                REPEAT
                    Out.Int(bottles, 2);
                    Out.String(" bottles of beer on the wall, ");
                    Out.Int(bottles, 2);
                    Out.String(" bottles of beer.");
                    Out.Ln;
                    Out.String("Take one down, pass it around, ");

                    DEC(bottles);

                    Out.Int(bottles, 2);
                    Out.String(" bottles of beer on the wall.");
                    Out.Ln
                UNTIL bottles = 1;

                Out.String("1 bottle of beer on the wall, one bottle of beer.");
                Out.Ln;
                Out.String("Take one down, pass it around,");
                Out.String(" no more bottles of beer on the wall");
                Out.Ln
           END Start;

END BottlesOfBeers.

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
object-oriented versionMichael Griebling04/20/050

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: