Jump to content

User:RaulMiller/99 Bottles of Beer computer program J Writeup

From Wikipedia, the free encyclopedia

This version features every bell and whistle I could find in the 99 Bottles of Beer writeup. As should be obvious from the code, most of the work involves the alternate forms for the third line of a stanza.

n=: 'No'"_`":@.(<&100)
bob=: n , ' bottles of beer'"_ -. 1&= # 's'"_
L1=: bob , ' on the wall'"_
L2=: bob , '!'"_
L3=: 100 1 &i. { ([;._2 noun define)"_
Go to the store and buy some more
if one of those bottles should happen to fall
Take one down, pass it around
)
L4=: L1@<:, '!'"_

l=:99#,:1 |. (L1, L2, L3,: L4)"0 (-i.)100