# XOR

### » Sun Jan 02, 2011 1:05 pm

Hi, I'm trying to do a simple XOR calculation, but can't find it anywhere in the program, documentation, or forum.

E.g. 0 XOR 0 = 1, 1 XOR 0 = 1

or more specifically, 1234 xor 3210 = 2136

Is there an easy way to do this in Construct?
B
2
S
1
G
4
Posts: 26
Reputation: 1,252

### » Sun Jan 02, 2011 2:24 pm

[quote="Muz":2bq3b0j5]
E.g. 0 XOR 0 = 1, 1 XOR 0 = 1[/quote:2bq3b0j5]
0 xor 0 = 0
0 xor 1 = 1
1 xor 1= 0
exclusive or is only true if one or the other is true, but not both
[quote:2bq3b0j5]or more specifically, 1234 xor 3210 = 2136[/quote:2bq3b0j5]
I'm not sure what you did there, but...
[quote:2bq3b0j5]Is there an easy way to do this in Construct?[/quote:2bq3b0j5]
...if it was a bitwise or or xor, no construct does not have any bitwise operators
here's a complete list of system expressions:
http://sourceforge.net/apps/mediawiki/c ... xpressions

if it was a simple exclusive or condition, you can do that by stacking comparison conditions
if a
---if [inverted] b
OR
if b
---if [inverted] a
------------do something
Spriter Dev
B
103
S
22
G
12
Posts: 3,285
Reputation: 17,151

### » Sun Jan 02, 2011 4:03 pm

Whoops, 0 xor 0 = 0, sorry it's late night

If there's no easy way, is there a harder way to calculate it? Bitwise, not the condition thing.
B
2
S
1
G
4
Posts: 26
Reputation: 1,252

### Who is online

Users browsing this forum: No registered users and 0 guests