99 Bottles of Beer/Lisp: Difference between revisions
Content added Content deleted
m (updated Ol sample) |
(Make the format string prettier (riiight)) |
||
Line 35: | Line 35: | ||
<lang lisp>(defun bottles (x) |
<lang lisp>(defun bottles (x) |
||
(loop for bottles from x downto 1 |
(loop for bottles from x downto 1 |
||
do (format t "~a bottle~:p of beer on the wall |
do (format t "~a bottle~:p of beer on the wall~@ |
||
~:*~a bottle~:p of beer |
~:*~a bottle~:p of beer~@ |
||
Take one down, pass it around |
Take one down, pass it around~@ |
||
~a bottle~:p of beer on the wall~2%" |
~a bottle~:p of beer on the wall~2%" |
||
bottles (1- bottles))))</lang> |
|||
and then just call |
and then just call |
||
<lang lisp>(bottles 99)</lang> |
<lang lisp>(bottles 99)</lang> |