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 REXX

(now w/ "xx bottles of beer on the wall")

Date:10/23/08
Author:R. Mark Enright
URL:n/a
Comments:0
Info:http://en.wikipedia.org/wiki/REXX
Score: (2.87 in 23 votes)
/* REXX VERSION OF THE BOTTLES PROGRAM */
/* BY R. MARK ENRIGHT                  */
DO FOREVER
   DO I = 99 TO 1 BY -1
      IF I > 1 THEN PLURAL_1 = 'BOTTLES'
               ELSE PLURAL_1 = 'BOTTLE'
      IF I = 2 THEN PLURAL_2 = 'BOTTLE'
               ELSE PLURAL_2 = 'BOTTLES'
      SAY I PLURAL_1 'OF BEER ON THE WALL,' I PLURAL_1 'OF BEER'
      SAY 'TAKE ONE DOWN, PASS IT AROUND,' I-1 PLURAL_2 'OF BEER ON THE WALL.'
   END
   SAY 'NO MORE BOTTLES OF BEER ON THE WALL, NO MORE BOTTLES OF BEER'
   SAY 'GO TO THE STORE AND BUY SOME MORE'
END

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
Recursive MethodLaurent KUPERBERG11/26/090

Comments

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: