Skip to content

Instantly share code, notes, and snippets.

@clickclickmoon
Created May 22, 2011 21:06
Show Gist options
  • Save clickclickmoon/985892 to your computer and use it in GitHub Desktop.
Save clickclickmoon/985892 to your computer and use it in GitHub Desktop.
99 bottles of beer on the wall in crisp
song[
[ This is the '99 bottles of beer on the wall' little puzzle from Rosetta Code.
The expected output is in (you'll never guess) expected.output for running
this program as a unit test.
comment]
exported[sing/0 list]
author[Andy Brown (click) <click.click.moon@gmail.com> string]
_beer_[of beer on the wall! string]
sing[
[[99 #] sing]
defun]
sing[
[[No more bottles _beer_ string] puts]
[[0 #] is]
defun]
sing[
[ [[One bottle _beer_ string] puts]
[[0 #] sing]
do]
[[1 #] is]
defun]
sing[
[ [[[beers %] bottles _beer_ string] puts]
[[beers [1 #] -] sing]
do]
beers[any]
defun]
module]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment