99 bottles of beer: Difference between revisions
Content added Content deleted
(Add Ecstasy example) |
|||
Line 6,009: | Line 6,009: | ||
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 |
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 </pre> |
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 </pre> |
||
=={{header|Janet}}== |
|||
<syntaxhighlight lang="janet"> |
|||
(defn bottles [n] |
|||
(match n |
|||
0 "No more bottles" |
|||
1 "1 bottle" |
|||
_ (string n " bottles"))) |
|||
(loop [i :down [99 0]] |
|||
(print |
|||
(bottles i) " of beer on the wall\n" |
|||
(bottles i) " of beer\nTake one down, pass it around\n" |
|||
(bottles (- i 1)) " of beer on the wall\n\n")) |
|||
=={{header|Java}}== |
=={{header|Java}}== |