Skip to content

Instantly share code, notes, and snippets.

@wofockham
Created March 2, 2014 22:07
Show Gist options
  • Save wofockham/e6fa9547f5f0001c7a8c to your computer and use it in GitHub Desktop.
Save wofockham/e6fa9547f5f0001c7a8c to your computer and use it in GitHub Desktop.

99 Bottles of Beer

Write a program which prints out the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.

Requirements

  • Your file should be called beer.rb
  • The program should be called with Beer.song
  • The program should output to STDOUT using puts
  • Each verse should be separated by a single blank line.

Data

Here's a sampling of the lyrics...

99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.

98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bottles of beer on the wall.

97 bottles of beer on the wall, 97 bottles of beer.
Take one down and pass it around, 96 bottles of beer on the wall.

Then, at the end...

1 bottle of beer on the wall, 1 bottle of beer.
Take it down and pass it around, no more bottles of beer on the wall.

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