Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

90% of /prog/ can't write FizzBuzz

Name: The antagonist 2008-04-25 12:38

Prove me wrong

Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

Name: Anonymous 2008-04-25 14:35

>>11
NOT GOOD ENOUGH!
1. Make a loop from 1 to 100, and do all 100 checks in it ((i==1) and (ifcheck_div(1, 3, "Fizz") or check_div(1, 5, "Buzz")), or whatever that would be in your FIOC language)
2. MORE INDENTATION!
if(i==1){
    ...
} else if(i==2){
    ...
} else if(i==3){
    ...

—bad idea!!! This is how you do it:
if(i==1){
    ...
} else{
    if(i==2){
        ...
    } else{
        if(i==3){
            ...
        } else{
            ...
        }
    }
}


You have ways to go!
Oh, and your language sucks!!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List