Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts; puts " It's beer song time!"; puts
- @count = 99
- @container = "bottle"
- @getDrunkBy = @count - 10
- def bottles(n, container)
- n == 1 ? "#{n} #{container}" : "#{n} #{container}s"
- end
- def getDrunk(str, n, by)
- by <= n ? str : str.split(' ').shuffle.join(' ').capitalize
- end
- @count.downto(1) {
- puts <<BEERSONG
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #{bottles(@count, @container)} of beer on the wall
- #{bottles(@count, @container)} of beer
- #{getDrunk('Take one down pass it around', @count, @getDrunkBy)}
- #{bottles(@count -= 1, @container)} of beer on the wall
- BEERSONG
- }
- puts "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
- puts; puts " No more beer on the wall :-("
- puts " And I'm on the floor"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement