Created
August 23, 2013 23:36
-
-
Save monajalal/6325002 to your computer and use it in GitHub Desktop.
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 Beer | |
def self.song | |
array=(1..99).to_a.reverse | |
array.each do |a| | |
if a==1 | |
puts "No bottles of beer on the wall, no bottles of beer.\nTake one down and pass it around, 99 bottles of beer on the wall" | |
else | |
puts "#{a} bottles of beer on the wall, #{a} bottles of beer.\nTake one down and pass it around, #{a-1} bottles of beer on the wall" | |
end end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment