Created
May 7, 2012 20:16
-
-
Save coryschires/2630121 to your computer and use it in GitHub Desktop.
Bottle of beer examples
This file contains 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
bottle_num = 100 | |
# You can clean up the the puts statement using interpolation (i.e. "Some words #{a_variable} and more words") | |
# | |
while bottle_num > 0 | |
puts "#{bottle_num -= 1} bottles of beer on the wall" | |
end | |
# Or you could even one line it. | |
# | |
puts "#{bottle_num -= 1} bottles of beer on the wall" until bottle_num.zero? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment