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

Date:04/20/05
Author:Lee Stewart
URL:n/a
Comments:2
Info:n/a
Score: (3.42 in 31 votes)
/* Rexx Version of the Bottles program */
/* by Lee Stewart (ls@sweng.stortek.com) */
   Trace Off;
   Do Forever;
      Do i = 99 To 1 By -1;
         If i > 1 Then pl = 's';
                  Else pl = '';
         Say i 'bottle'pl 'of beer on the wall,' i 'bottle'pl 'of beer';
         Say 'Take one down, pass it around';
         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
now w/ "xx bottles of beer on the wall"R. Mark Enright10/23/080

Comments

>>  Dave Salt said on 04/22/08 17:48:35

Dave Salt The REXX code appears slightly more complicated than it needs to be (even though what's shown is already very simple). TRACE OFF is the default and therefore doesn't need to be specified, and a closing semi-colon is assumed at the end of each line of REXX and therefore also doesn't need to be specified.

>>  Michael Buckley said on 04/23/08 07:10:00

Michael Buckley The code results in the following

99 bottles of beer on the wall, 99 bottles of beer
Take one down and pass it around

98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around

etc. The second line should actually be "Take one down and pass it around, xx bottles of beer on the wall"



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: