99bottles.frink

View or download 99bottles.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/

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

getBottleString[n] := (n==0 ? "No more" : n) + " bottle" + (n==1 ? "" : "s") +
                      " of beer"


View or download 99bottles.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 17645 days, 8 hours, 31 minutes ago.