Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

99 Bottles Of Beer

DZone's Guide to

99 Bottles Of Beer

·
Free Resource
def bottle(x)
  case x
  when 0 then "no more bottles"
  when 1 then "1 bottle"
  else        "#{x} bottles"
  end + " of beer"
end

99.downto(1) do |i|
  puts <
 
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}