99 Bottles of Beer/Lisp: Difference between revisions

From Rosetta Code
Content added Content deleted
(new subpage)
 
(moving code from main task-page to sub-page)
Line 9: Line 9:
See [[99 Bottles of Beer/Lisp]]
See [[99 Bottles of Beer/Lisp]]
-->
-->

=={{header|PicoLisp}}==
<lang PicoLisp>(de bottles (N)
(case N
(0 "No more beer")
(1 "One bottle of beer")
(T (cons N " bottles of beer")) ) )

(for (N 99 (gt0 N))
(prinl (bottles N) " on the wall,")
(prinl (bottles N) ".")
(prinl "Take one down, pass it around,")
(prinl (bottles (dec 'N)) " on the wall.")
(prinl) )</lang>

Revision as of 05:30, 21 November 2014

99 Bottles of Beer/Lisp is part of 99 Bottles of Beer. You may find other members of 99 Bottles of Beer at Category:99 Bottles of Beer.

99 Bottles of Beer done in Lisp-languages


PicoLisp

<lang PicoLisp>(de bottles (N)

  (case N
     (0 "No more beer")
     (1 "One bottle of beer")
     (T (cons N " bottles of beer")) ) )

(for (N 99 (gt0 N))

  (prinl (bottles N) " on the wall,")
  (prinl (bottles N) ".")
  (prinl "Take one down, pass it around,")
  (prinl (bottles (dec 'N)) " on the wall.")
  (prinl) )</lang>