Bitwise

That would do the trick :smiley: Thanks Scallio :smiley:

er, for the record, xor isn’t bitwise, the bitwise operator is ^

but meh :slight_smile:

Yeah, but that solution performs the same trick without using bitwise

I do have integers :smiley: It works as it is so I won’t be rewriting it in to if/else logic, but I’d rather now know how to get the result I’m after using bitwise properly

That post probably changed as well :slight_smile: must be the wine :frowning:

At any rate, if you have integers, then bitwise is good (eg E_ALL etc), but if not, probably just better to use some logic.

Yeah, your previous post has mysteriously disappeared :smiley:

It just seemed easier (in my head) to use bitwise to check that the correct bits are set rather than writing a series of if/else conditions. As it stands, my implementation using the array works perfectly, it’s just not quite the solution I was looking for. Oh well