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 Sather

Date:04/20/05
Author:David Stoutamire
URL:n/a
Comments:1
Info:http://www.icsi.berkeley.edu/Sather
Score: (3.00 in 65 votes)
-- Sather for 99 Bottles of Beer
--
-- David Stoutamire (davids@icsi.berkeley.edu)

class MAIN is
   main is
      loop
         b::=99.downto!(1);
         #OUT + bob(b) + " on the wall, "
              + bob(b) + ".\n"
              + "Take one down, pass it around, "
              + bob(b-1) + " on the wall.\n\n";
      end
   end;

   bob(i:INT):STR is
      case i
      when 0 then return "no more bottles of beer";
      when 1 then return "1 bottle of beer";
      else return i.str + " bottles of beer";
      end
   end
end

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
A more elaborate versionMichael Talbot-Wilson06/06/093

Comments

>>  Glen said on 03/03/06 01:22:19

Glen Works with Gnu Sather 1.2.2 on Slackware 10.2

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: