XOR

For questions about using Classic.

Post » 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
G
4
Posts: 26
Reputation: 1,102

Post » 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
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun Jan 02, 2011 4:03 pm

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

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


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 10 guests