0

Can someone explain this what it is doing?

if ( condition1 && condition2 && condition3 && condition4 && condition5 ) { code }

It doesn't do what I want it to do but this does.

if ( condition1 ) {
    if ( condition2 ) {
        if ( condition3 ) {
            if ( condition4 ) {
                if ( condition5 ) {
                    code
                }
            }
        }
    }
}

Edited by nouth

2
Contributors
3
Replies
16
Views
3 Years
Discussion Span
Last Post by stultuske
0

I thought they were different but it turns out there is a bug with my logical process. And after running the code enough times the second code began to act the same as the first code, it was just by luck that it seemed to fix itself.

Edited by nouth

0

code doesn't really "fix itself". if the problem existed for certain input, it'll still be there. you should look into that to see if you didn't make an error in placing a bracket or something

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.