[quote name='coderWalker' timestamp='1301522881' post='4792361']
Thanks everyone! I think the best thing to do is just negate the statement.
I never even thought of that solution
No, that's the easy way out. The best thing to do it to understand boolean algebra and design the logic to properly describe what you want it to do.
Yea the If statements are pretty bad.
I really need to make them more readable somehow.
I Always seem to over complicate things.
In my opinion, what makes your if-statement ugly and difficult to read is the way your function calls look like. Many calculations and multiple parameters that perhaps should be collected in structures. For example, not only should you factor out the calculations like owl demonstrated, but is there a reason you're not sticking your (what appears to be) vectors in a vector structure to collect three linked parameters into one?
If you do, then your two functions only take two parameters, and one can be calculated outside the function calls. Then you don't even have to calculate the individual boolean results like owl did. What you gain by that is short circuiting, in that the second function call doesn't have to be evaluated if the first one completely determines the outcome of the entire expression. And the if-statement doesn't become messy anyway, since the function calls are clean and compact looking.
[/quote]
Me and Owl must of posted at the exact same time. I didn't even see it, but now I do. I think Owl's is best also
combining it like he did also saves some computing time. Since it just reads from memory and doesn't have to calculate.