Team Leader
1Jun2009,16:11   #21
pradeep's Avatar
Code: Java
for(int i = 0 ; i <= 100 ; i++)
{
    if(i % 3 == 0 && i % 5 == 0)
    {
        System.out.println("FizzBuzz");
    }
    else if(i % 3 == 0)
    {
        System.out.println("Fizz");
    }
    else if(i % 5 == 0)
    {
        System.out.println("Buzz");
    }
    else
    {
        System.out.println(i);
    }
}
Mentor
1Jun2009,16:34   #22
xpi0t0s's Avatar
Quote:
Originally Posted by SaswatPadhi View Post
Finalllyyyy... After struggling with BrainF*ck for 3 hours, I conclude that the language truly justifies its name !
Heh, well done there. I was trying to put a Brainf*ck one together but gave up after well over 3 hours.
~ Б0ЯИ Τ0 С0δЭ ~
1Jun2009,18:27   #23
SaswatPadhi's Avatar
Thanx !

Programming with Brainf*ck requires a lot of patience. While writing this code, many times it came to me "Why should I write it ?". I was ready to give up, but then I thought I had no better way to utilize my time ! But, BF truely f*cks Brain.

Last edited by SaswatPadhi; 1Jun2009 at 18:32..
Team Leader
1Jun2009,18:44   #24
pradeep's Avatar
Check this out guys http://golf.shinh.org/p.rb?FizzBuzz
~ Б0ЯИ Τ0 С0δЭ ~
1Jun2009,18:55   #25
SaswatPadhi's Avatar
OMG !!!

Whitespace, Befunge !
~ Б0ЯИ Τ0 С0δЭ ~
30Jun2009,00:07   #26
SaswatPadhi's Avatar
The program in Mathematica 7
Code: Mathematica
For[i = 1, i < 101, i++, If[Mod[i, 3] == 0, If[Mod[i, 5] == 0, Print["FIZZBUZZ"], Print["FIZZ"]], If[Mod[i, 5] == 0, Print["BUZZ"], Print[i]]]]