Error with OR in MacBook

Good morning,
I’m beginning using Processing and I’ve problems writing down the OR simbol. Processing gives my ERROR when I write it in my MacBook. I’m using || (alt + 1) but also I’ve tried to copy+paste directly of a good code already writed. In both cases the result is ERROR.

OR_problems

Thank you for your time.

1 Like

basically the logic expression must have a ( ) in a whole.

int a = 10, b = 20, x = 300;
if       ( a > 5 || b < 30 )   rect (35,35,30,30);
else if  ( x >= 300)           circle(50,50,72);            // wrong logic  
else                           triangle(30,70,50,30,70,70);

but you might use

if ( (a > 5) || (b < 30) )  { rect (35,35,30,30); }
1 Like

I’ve tried and both sytems goes perfect!!!
Thank you very much kll!!!

1 Like