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 Simula

(Corrected version)

Date:03/10/07
Author:Jack Leunissen
URL:n/a
Comments:0
Info:n/a
Score: (2.75 in 4 votes)
BEGIN
  COMMENT
     Simula version of 99 beers
     Maciej Macowicz (mm@cpe.ipl.fr)
     Status: UNTESTED :)

     Amended 2007-03-10 by Jack Leunissen (jack.leunissen@wur.nl)
     Status: WORKING (at least it prints and counts correctly)
  ;
  INTEGER bottles;
  INTEGER num;

  num := 2;
  FOR bottles:= 99 STEP -1 UNTIL 1 DO 
  BEGIN
    IF (bottles < 10) THEN num := 1;
    OutInt(bottles,num);
    OutText(" bottle(s) of beer on the wall, ");
    OutInt(bottles,num);
    OutText(" bottle(s) of beer");
    OutImage;
    Outtext("Take one down, pass it around, ");
    OutInt(bottles - 1,num);
    OutText(" bottle(s) of beer on the wall. ");
    OutImage;
    OutImage;
  END;
  OutText("1 bottle of beer on the wall, one bottle of beer."); 
  OutImage;
  OutText("Take one down, pass it around, ");
  OutText("no more bottles of beer on the wall");
  OutImage
END

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: