Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
99 Bottles of Beer in CoffeeScript
#!/usr/bin/env coffee
print = (line) -> process.stdout.write line + '\n'
for num in [99..1]
if num > 1
print "#{num} bottles of beer on the wall, #{num} bottles of beer."
if num-1 > 1
print "Take one down and pass it around, #{num-1} bottles of beer on the wall.\n"
else
print "Take one down and pass it around, #{num-1} bottle of beer on the wall.\n"
else
print "#{num} bottle of beer on the wall, #{num} bottle of beer."
print "Take one down and pass it around, no more bottles of beer on the wall.\n"
print """No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall."""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.