|Score:||(2.50 in 10 votes)|
% 99 Bottles of Beer in Emerald % by David Eddyshaw <email@example.com> 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
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!