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 Modula 2

Date:04/20/05
Author:Jeremy Rule
URL:n/a
Comments:2
Info:n/a
Score: (2.80 in 10 votes)
(* Modula-2 version of 99 Bottles of Beer            *)
(* Tested on a VAX 7700 running OpenVMS              *)
(* Programmer: Jeremy Rule  rulej@tempest.adsnet.net *)
MODULE BottlesOfBeer;

FROM InOut IMPORT WriteCard, WriteString, WriteLn;

CONST
        BOTTLES = 99;
VAR
        counter : CARDINAL;
BEGIN
        counter := BOTTLES;
        REPEAT
                WriteCard( counter,2 );
                WriteString(" bottles of beer on the wall, ");
                WriteCard( counter,2 );
                WriteString(" bottles of beer."); WriteLn;
                WriteString(" Take one down, and pass it around, ");
                DEC( counter );
                WriteCard( counter,2 );
                WriteString(" bottles of beer on the wall."); WriteLn;
        UNTIL ( counter = 1 );
        WriteString("1 bottle of beer on the wall, 1 bottle of beer"); WriteLn;
        WriteString("Take it down and pass it around, ");
        WriteString("No more bottles of beer on the wall."); WriteLn;

END BottlesOfBeer.

Download Source | Write Comment

Alternative Versions

Comments

>>  Nobodz said on 07/12/07 19:43:49

Nobodz will write: 1 bottles of beer ;-(

>>  Terry Ross said on 09/08/08 14:41:50

Terry Ross Nice :) - I've put up an ISO Modula-2 version at http://www.99-bottles-of-beer.net/language-modula-2-1856.html

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: