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
Version | Author | Date | Comments | Rate |
---|---|---|---|---|
Recursive Method | Laurent KUPERBERG | 11/26/09 | 0 | |
now w/ "xx bottles of beer on the wall" | R. Mark Enright | 10/23/08 | 0 |
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
Dave Salt said on 04/22/08 17:48:35
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
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"