Skip to content

Instantly share code, notes, and snippets.

@fchurca
Forked from mtimkovich/beer-song.lisp
Last active February 17, 2016 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fchurca/d788c9df76d4491fb625 to your computer and use it in GitHub Desktop.
Save fchurca/d788c9df76d4491fb625 to your computer and use it in GitHub Desktop.
Beer song in Lisp
(defun beer-song (n)
(format t "~a bottle~:*~p of beer on the wall.~%" n)
(format t "~a bottle~:*~p of beer.~%" n)
(format t "Take one down.~%")
(format t "Pass it around.~%")
(decf n)
(if (> n 0)
(progn
(format t "~a bottle~:*~p of beer on the wall.~%" n)
(beer-song n))
(format t "No more bottles of beer on the wall.~%")))
(beer-song 99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment