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 APL

(version two)

Date:05/30/05
Author:JT. Taylor
URL:http://www.jttaylor.net/
Comments:1
Info:n/a
Score: (3.00 in 23 votes)
⍝ APL (A Programming Language)

⍝ Program written by JT. Taylor, www.jttaylor.net

T1←98↑[1]ØΦ1 99ρι99

T4←ØΦ1 98ρι98

T1,(98 30ρ’ BOTTLES OF BEER ON THE WALL, ‘),T1,(98 47ρ’BOTTLES OF BEER, TAKE ONE DOWN, PASS
IT AROUND,’),T4,(98 28ρ’BOTTLES OF BEER ON THE WALL ,’)

‘1 BOTTLE OF BEER ON THE WALL, 1 BOTTLE OF BEER, TAKE IT DOWN, PASS IT AROUND, NO BOTTLES OF BEER
ON THE WALL.’

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
version oneJohn A. Estep05/22/055

Comments

>>  JS Brilleaud said on 10/21/05 00:49:23

JS Brilleaud For better lisibility, I tried to write it this way (I don't guarantee the exact count of white spaces)

T <- (- iota 98) outer.+ ,100
Z <- (fmt T), (98 30 rho ' BOTTLES OF BEER ON THE WALL, ')
Z <- Z, (fmt T), (98 47 rho ' BOTTLES OF BEER, TAKE ONE DOWN, PASS IT AROUND, ')
Z, (fmt T-1), (98 28 rho ' BOTTLES OF BEER ON THE WALL.')
'1 BOTTLE OF BEER ON THE WALL, 1 BOTTLE OF BEER, TAKE IT DOWN, PASS IT AROUND, NO BOTTLES OF BEER ON THE WALL.'

nb. the idea is to build an array with lines for from 99 to 2 bottles , print it, then print line for 1 bottle.
nb. iota, outer, fmt, rho are to be replaced with corresponding APL symbols.

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: