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 Gensym G2

Date:01/26/10
Author:Andrea Liew
URL:n/a
Comments:1
Info:http://www.gensym.com/documents/g2%208.2%20datasheet.pdf
Score: (3.00 in 10 votes)
beer-bottles()
 
i:integer =99;
j:integer;
constant:integer =-1;
 
begin
for i=99 down to 1
    do
    j = (i+constant);
        if (i=1) then begin
            post"[i] bottle of beer on the wall";
            post" [i] bottle of beer";
            post" Take one down and pass it around ";
            post" No bottle of beer on the wall"; 
        end 
        else begin
            post"[i] bottles of beer on the wall";
            post" [i] bottles of beer";
            post" Take one down and pass it around ";
            if (i=2) then 
                post" [j] bottle of beer on the wall"
           else
                post" [j] bottles of beer on the wall"; 
           end
    end
end

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
Object-oriented simulationShaun J06/17/100

Comments

>>  Siang Heng said on 02/11/10 07:46:06

Siang Heng Very neat.

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: