99 Bottles of Beer/Lisp: Difference between revisions
Content added Content deleted
(moving code from main task-page to sub-page) |
(moving code from main task-page to sub-page) |
||
Line 35: | Line 35: | ||
Note, by the way, how the emoticons <tt>:*~D</tt> and <tt>:P</tt> have shown up in the format string. FORMAT is so powerful, it's even self-aware about how silly it is. |
Note, by the way, how the emoticons <tt>:*~D</tt> and <tt>:P</tt> have shown up in the format string. FORMAT is so powerful, it's even self-aware about how silly it is. |
||
=={{header|NewLISP}}== |
|||
<lang newlisp>(for (n 99 1) |
|||
(println n " bottles of beer on the wall," n " bottles of beer. Take one down, pass it around. ") |
|||
(println (- n 1) "bottles of beer on the wall!")) |
|||
;;recursive |
|||
;;also shows list afterword |
|||
(define (rec bottles) |
|||
(if (!= 0 bottles) (print "/n" bottles " bottles of beer on the wall" bottles " bottles of beer. |
|||
\nTake one down, pass it around, " (- bottles 1) |
|||
" bottles of beer on the wall" (rec ( - bottles 1))))(list bottles)) |
|||
(rec 99)</lang> |
|||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |