![]() | ![]() |
|
Course Outline [ HTML
] [ PS
] [ PDF ] Guidlines for Choosing a Password Class Files Class Discussion List HyperText Markup Language J Software The J Help System Juggle (J on Unix; Martin Neitzel's J Work) About the J Programming Language J Primer [ HTML ] [ PS ] [ PDF ] J Dictionary [ HTML ] [ PS ] [ PDF ] J Phrases [ HTML ] [ PS ] [ PDF ] Other J Documentation GNU Plot Manual [ PS ] [ PDF ] ACM Special Intrest Group on APL and J SIGAPL Journal of the British APL Association Vector J Frequently Asked Questions Symbol Minded Tom Van Vleck's Software Engineering Stories Tom Van Vleck's Stories from the MULTICS System Computer Jargon Dictionary Latest J Books Succinctness is Power by Paul Graham A Small Sampling of Dr. Kenneth E. Iverson's J Papers and Awards Professor Keith Smillie's J Papers Linda Alvord and Norman Thomson Professor Clifford A. Reiter's J Papers Stevan Apter's "no stinking loops" Professor Ewart Shaw's J Papers Professor John Howland's J Papers Other Papers |
|
Course Notes Laboratory Problems |

Date: Thu, 8 Mar 2001 09:23:02 -0500 From: Roger HuiReply-To: forum@jsoftware.com To: APL Mailing List , J Forum , TimTroyR@ionet.net Subject: Jforum: Re: New Scientist Puzzle and Oddball Languages NB. a solution in J (http://www.jsoftware.com) to the 99 Bottles of Beer problem. bob =: ": , ' bottle'"_ , (1: = ]) }. 's of beer'"_ bobw=: bob , ' on the wall'"_ beer=: bobw , ', '"_ , bob , '; take one down and pass it around, '"_ , bobw@<: NB. For example: beer"0 >:i.-5 5 bottles of beer on the wall, 5 bottles of beer; take one down and pass it around, 4 bottles of beer on the wall 4 bottles of beer on the wall, 4 bottles of beer; take one down and pass it around, 3 bottles of beer on the wall 3 bottles of beer on the wall, 3 bottles of beer; take one down and pass it around, 2 bottles of beer on the wall 2 bottles of beer on the wall, 2 bottles of beer; take one down and pass it around, 1 bottle of beer on the wall 1 bottle of beer on the wall, 1 bottle of beer; take one down and pass it around, 0 bottles of beer on the wall beer"0 >:i.-10 10 bottles of beer on the wall, 10 bottles of beer; take one down and pass it around, 9 bottles of beer on the wall 9 bottles of beer on the wall, 9 bottles of beer; take one down and pass it around, 8 bottles of beer on the wall 8 bottles of beer on the wall, 8 bottles of beer; take one down and pass it around, 7 bottles of beer on the wall 7 bottles of beer on the wall, 7 bottles of beer; take one down and pass it around, 6 bottles of beer on the wall 6 bottles of beer on the wall, 6 bottles of beer; take one down and pass it around, 5 bottles of beer on the wall 5 bottles of beer on the wall, 5 bottles of beer; take one down and pass it around, 4 bottles of beer on the wall 4 bottles of beer on the wall, 4 bottles of beer; take one down and pass it around, 3 bottles of beer on the wall 3 bottles of beer on the wall, 3 bottles of beer; take one down and pass it around, 2 bottles of beer on the wall 2 bottles of beer on the wall, 2 bottles of beer; take one down and pass it around, 1 bottle of beer on the wall 1 bottle of beer on the wall, 1 bottle of beer; take one down and pass it around, 0 bottles of beer on the wall beer"0 >:i.-101 101 bottles of beer on the wall, 101 bottles of beer; take one down and pass it around, 100 bottles of beer on the wall 100 bottles of beer on the wall, 100 bottles of beer; take one down and pass it around, 99 bottles of beer on the wall 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 ...
![]() |
Site Index
|
CS WebMail CS ListServer |