Quote:
|
Originally Posted by jake13jake
Tell me, why would you write
if( (x==2) || (x==3) || (x==5) || (x==7) )
When you could write
if( (1<<x) & ((1<<2)|(1<<3)|(1<<5)|(1<<7) )
I'll tell you what though, I've only been recently learning how to use bitwise operators.
|
If you are using the new engine...
NPC Code:
if (x in {1, 2, 3, 5, 7})