Created
December 24, 2014 20:56
-
-
Save egrueter-dev/2e3091da0cfe69a02e86 to your computer and use it in GitHub Desktop.
99bottles
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
class Song | |
def booze (bottle, number) | |
@bottle = bottle | |
@number = number | |
end | |
def sing | |
while number != 0 | |
puts "#{number} Bottles of #{bottle} on the wall, #{number} bottles of #{bottle}, you take one down, pass it around #{number-1} bottles of #{bottle} on the wall" | |
number -= 1 | |
end | |
end | |
end | |
99bottles = Song.new('wine', 18) | |
99bottles.sing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does something change about the Song.new part of the program at the bottom?
Thanks,
Erik