Language Emerald
| Date: | 04/20/05 |
| Author: | David Eddyshaw |
| URL: | n/a |
| Comments: | 0 |
| Info: | n/a |
| Score: |
% 99 Bottles of Beer in Emerald
% by David Eddyshaw <david@jeddyshaw.freeserve.co.uk>
const beer <- object beer
initially
for i : Integer <- 99 while i > 0 by i <- i - 1
self.bottles[i]
stdout.putstring[" of beer on the wall,\n"]
self.bottles[i]
stdout.putstring[" of beer.\n"]
stdout.putstring["Take one down and pass it around;\n"]
self.bottles[i-1]
stdout.putstring[" of beer on the wall.\n\n"]
end for
end initially
operation bottles [x : Integer]
if x = 0 then
stdout.putstring["No more bottles"]
elseif x = 1 then
stdout.putstring["1 bottle"]
else
stdout.putint[x,0]
stdout.putstring[" bottles"]
end if
end bottles
end beer
Download Source | Write Comment
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