Skip to content

Instantly share code, notes, and snippets.

@gr33n7007h
Created March 29, 2016 17:54
Show Gist options
  • Save gr33n7007h/a3752f53556d6a41fc9ea93a529f07bf to your computer and use it in GitHub Desktop.
Save gr33n7007h/a3752f53556d6a41fc9ea93a529f07bf to your computer and use it in GitHub Desktop.
99bob
#!/usr/bin/env ruby
v = %|%d bottle%s of beer on the wall, %d bottle%s of beer\ntake one down, pass it around, %d bottle%s of beer on the wall.\n\n|
s = -> (i) { i != 1 ? ?s : '' }
99.step(1, -1).each { |i| puts v % [i, s[i], i, s[i], i-1, s[i-1]] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment