File: io

package info (click to toggle)
ruby-rouge 4.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,844 kB
  • sloc: ruby: 38,489; sed: 2,071; perl: 152; makefile: 8
file content (11 lines) | stat: -rw-r--r-- 311 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
bottle := method(i,
  if(i==0, return "no more bottles of beer")
  if(i==1, return "1 bottle of beer")
  return i asString .. " bottles of beer"
)

for(i, 99, 1, -1,
  write(bottle(i), " on the wall, ", bottle(i), ",\n")
  write("take one down, pass it around,\n")
  write(bottle(i - 1), " on the wall.\n\n")
)