[Skip Navigation] [CSUSB] / [CNS] / [Comp Sci Dept] / [R J Botting] / [Samples] / 99beers
[Index] [Contents] [Source Text] [About] [Notation] [Copyright] [Comment/Contact] [Search ]
Tue Sep 18 15:24:56 PDT 2007

Contents


    99 Bottles of Beer on the Wall

      You'd have a lot more fun if you went to the following site: [ beer.html ]

      MATHS description

    1. song::= ! verse(99-(1..98;Id)) ! e. This means: concatenate 99 verses number 99,98,97,....0 and and e end verse.

    2. For i:1..99, verse(i)::= botw(b(i)) t1d b(i-1) otw "\n".

    3. botw(x)::=x otw x ";\n".
    4. b::(0..)->string= 0+>"No more bottles of beer" | 1 +> " 1 bottle of beer" | map[i:2..] (i " bottles of beer").
    5. (above)|-b = following,
      ib(i)
      0"No more bottles of beer"
      1"1 bottle of beer"
      2..i ! " bottles of beer"

    6. otw::=" on the wall.\n".
    7. t1d::="Take one down, pass it around, \n".
    8. e::= botw(0) "Go to the store and buy some more... ".

    . . . . . . . . . ( end of section 99 Bottles of Beer on the Wall) <<Contents | End>>

End