Euflorium: The Eufloria Community

Eufloria => Eufloria Classic => Eufloria Classic Mods => Topic started by: Aino on February 06, 2011, 09:59:25 AM

Title: if conditions: 'or' and 'and' = true?
Post by: Aino on February 06, 2011, 09:59:25 AM
So if you have:
if a == 0 or a == 2 and b < c then

end

What happens then?
Title: Re: if conditions: 'or' and 'and' = true?
Post by: annikk.exe on February 06, 2011, 10:02:22 AM
Unpredictable results.  Best not to mix your "ands" and "ors".

A better way is like this:


Code: [Select]
if a == 0 or a == 2 then
if b < c then
--do stuff
end
end
Title: Re: if conditions: 'or' and 'and' = true?
Post by: Aino on February 06, 2011, 10:04:20 AM
Unpredictable results.  Best not to mix your "ands" and "ors".

A better way is like this:


Code: [Select]
if a == 0 or a == 2
if b < c then
--do stuff
end
end

Yea, that will correct it hopelyfully, ty :)
Title: Re: if conditions: 'or' and 'and' = true?
Post by: annikk.exe on February 06, 2011, 10:05:31 AM
I corrected a typo in the code I posted. :>