99bottles2.frink

View or download 99bottles2.frink in plain text format

// "99 bottles of beer" program in Frink
// http://futureboy.us/frinkdocs/
// by Alan Eliasen
//
//  see
//  http://www.99-bottles-of-beer.net/

units = array[units[volume]]
showApproximations[false]

for n = 99 to 0 step -1
{
   unit = units.removeRandom[]
   str = getBottleString[n, unit]
   
   println["$str of beer on the wall, $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, " + getBottleString[n-1, unit] + " on the wall.\n"]
}

getBottleString[n, unit] := format[n*12 floz, unit, 6] + "s"


View or download 99bottles2.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17862 days, 9 hours, 33 minutes ago.