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: |
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
| Version | Author | Date | Comments | Rate |
|---|---|---|---|---|
| Object-oriented simulation | Shaun J | 06/17/10 | 0 |
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!
Comments