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 ARexx

(bugfix to my previous entry)

Date:11/13/05
Author:Harry Sintonen
URL:http://www.iki.fi/sintonen/
Comments:0
Info:http://en.wikipedia.org/wiki/AREXX
Score: (2.94 in 31 votes)
/* ARexx script version of 99 Bottles of Beer

   About ARexx: http://en.wikipedia.org/wiki/AREXX

   Written by Harry Sintonen <sintonen@iki.fi>.
*/

i = 99

do forever

  p = gen(i)
  say p 'on the wall,' p || '.'

  if i = 0 then leave

  i = i - 1

  say 'Take one down pass it around,' gen(i) 'on the wall.'

end

say 'Go to the store and buy some more, 99 bottles of beer on the wall.'
exit

gen: procedure
  a = arg(1)

  if a = 0 then m = 'no more bottles'
  else if a = 1 then m = a 'bottle'
  else m = a 'bottles'

  return m 'of beer'

Download Source | Write Comment

Alternative Versions

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: