[Skip Navigation] [CSUSB] / [CNS] / [CSE] / [R J Botting] / [Samples] / fizzbuzz
[Index] [Contents] [Source Text] [About] [Notation] [Copyright] [Comment/Contact] [Search ]
Wed Apr 25 11:03:50 PDT 2012

Contents


    Fizz Buzz -- Victorian Palour Game

      Solution 1 -- dfine a function and apply to range

    1. line::= ("Fizz" | "Buzz" | "FizzBuzz" | Nat) eol.
    2. fb::Nat -> line. For n: Nat, if n mod 15 = 0 then fb(n)="FizzBuzz". If n mod 15 <> 0 and n mod 5 = 0 then fb(n)="Buzz". If n mod 15 <> 0 and n mod 3 = 0 then fb(n)="Fizz". If n mod 5 <> 0 and n mod 3 <> 0 then fb(n)=n.

    3. output::= fb(1..100).

      Solution 2 -- parallel processes

      TBD

    . . . . . . . . . ( end of section Fizz Buzz -- Victorian Palour Game) <<Contents | End>>

End