Last active
August 29, 2015 14:11
-
-
Save loriculberson/81cc60235426446d286d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bottles = 99 | |
| until bottles < 0 | |
| if bottles > 2 | |
| puts "#{bottles} bottles of beer on the wall, #{bottles} bottles of beer.\nTake one down, pass it around, #{bottles-1} bottles of beer on the wall." | |
| elsif bottles == 2 | |
| puts "#{bottles} bottles of beer on the wall, #{bottles} bottles of beer.\nTake one down, pass it around, #{bottles-1} bottle of beer on the wall." | |
| elsif bottles == 1 | |
| puts "#{bottles} bottle of beer on the wall, #{bottles} bottle of beer.\nTake one down, pass it around, #{bottles-1} bottles of beer on the wall." | |
| else bottles == 0 | |
| puts "No more bottles of beer on the wall, no more bottles of beer.\nGo to the store, buy some more, 99 bottles of beer on the wall." | |
| end | |
| bottles -= 1 | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment