Language APL
(version two)
Date: | 05/30/05 |
Author: | JT. Taylor |
URL: | http://www.jttaylor.net/ |
Comments: | 8 |
Info: | n/a |
Score: | ![]() |
⍝ 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
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
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.
iota = shift I
rho = shift R
outer = shift O
fmt = shift N
If you don't believe me, save the page source and edit the content-type header. Voila!