99 bottles of beer: Difference between revisions

(Added Frink)
Line 1,542:
str = getBottleString[n, unit]
println["$str + " of beer on the wall, " + lc[$str] + "."]
 
if (n == 0)
println["Go to the store and buy some more, 99 bottles of beer on the wall."]
else
println["Take one down and pass it around, " + lc[getBottleString[n-1, unit]] + " on the wall.\n"]
}
 
getBottleString[n, unit] := format[n*12 floz, "${unit}", 6] + "s"
</lang>
 
Anonymous user