Skip to content

Instantly share code, notes, and snippets.

@egrueter-dev
Created December 24, 2014 20:56
Show Gist options
  • Save egrueter-dev/2e3091da0cfe69a02e86 to your computer and use it in GitHub Desktop.
Save egrueter-dev/2e3091da0cfe69a02e86 to your computer and use it in GitHub Desktop.
99bottles
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
@egrueter-dev
Copy link
Author

Does something change about the Song.new part of the program at the bottom?

Thanks,
Erik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment