99 bottles of beer: Difference between revisions

Content added Content deleted
m (→‎Sound: Fixed a number error)
(added common lisp example)
Line 57: Line 57:
}
}
}</c>
}</c>

=={{header|Common Lisp}}==
<lisp>(defun bottles (x)
(if (>= x 0)
(progn
(format t "~a bottles of beer on the wall~%" x)
(if (not (equal x 0))
(progn
(format t "~a bottles of beer~%" x)
(format t "Take one down, pass it around,~%")
(bottles (- x 1)))))))</lisp>

and then just call

<lisp>(bottles 99)</lisp>


=={{header|D}}==
=={{header|D}}==