Skip to content

Instantly share code, notes, and snippets.

@mtimkovich
Last active November 12, 2016 11:10
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 mtimkovich/0954e5c15fc117e4f54dd3ab6cde7019 to your computer and use it in GitHub Desktop.
Save mtimkovich/0954e5c15fc117e4f54dd3ab6cde7019 to your computer and use it in GitHub Desktop.
You already know
(use format)
(define (beer-song n)
(format #t "~A bottle~:P of beer on the wall.~%" n)
(format #t "~A bottle~:P of beer.~%" n)
(print "Take one down.")
(print "Pass it around.")
(let ((n (- n 1)))
(if (> n 0)
(begin
(format #t "~A bottle~:P of beer on the wall.~%" n)
(beer-song n))
(print "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