
-----------------------------------
haskell
Sat Mar 24, 2007 1:44 pm

Fizz-Buzz: The Multi-Language Challenge
-----------------------------------
Task

 To write the same program in as many languages as possible.

Purpose

 So people can see the same code written in as many languages as possible.

The Program

 Count from 1-100 and write the results. If the value is divisible by 3, than write "Fizz". If the value is divisible by 5, than write "Buzz". If the value is divisible by both 3 and 5, than write "FizzBuzz".

Rules

 State the language. Multiple solutions in the same language is acceptable. Use any means necessary :).

Enjoy :D

---

C++
string fizz_buzz;

for(int i = 1; i  100
         loop
            if evenly_divisible_by(count, 15) then
               std_output.put_string("FizzBuzz")
            elseif evenly_divisible_by(count, 3) then
               std_output.put_string("Fizz")
            elseif evenly_divisible_by(count, 5) then
               std_output.put_string("Buzz")
            else
               std_output.put_integer(count)
            end

            std_output.put_new_line
         end
      end
end

-----------------------------------
haskell
Sat Mar 24, 2007 2:32 pm

RE:Fizz-Buzz: The Multi-Language Challenge
-----------------------------------
C
int fizz_buzz(int, int);

int main()
{
    fizz_buzz(1, 100);    

    return 0;
}

int
fizz_buzz(int l, int h)
{
    if(l % 3 == 0) printf("Fizz");
    if(l % 5 == 0) printf("Buzz");
    else if(l % 3 != 0) printf("%d", l);
    
    printf("\n");

    if(l != h) return fizz_buzz(l + 1, h);
    else return 0;
}


-----------------------------------
wtd
Sat Mar 24, 2007 2:51 pm

RE:Fizz-Buzz: The Multi-Language Challenge
-----------------------------------
object Test extends Application {
   def evenlyDivisibleBy(a: Int, b: Int) = a % b == 0

   def fizzbuzz(a: Int, b: Int) {
      if (a 