# XOR - What it mean?

Get help using Construct 2

### » Tue Nov 01, 2011 5:00 pm

XOR - What it mean?
Many topics here are talking about it, using it, but no one really say what it's
B
92
S
18
G
12
Posts: 1,166
Reputation: 18,090

### » Tue Nov 01, 2011 5:07 pm

Exclusive or, and I wouldn't worry about it. Its the same as or as far as events are concerned.

http://en.wikipedia.org/wiki/Exclusive_or

"A simple way to state this is "one or the other but not both."

So its pretty much useless here, as separate conditions will do.
newt2011-11-01 17:23:35
B
160
S
48
G
80
Posts: 7,237
Reputation: 61,502

### » Tue Nov 01, 2011 5:29 pm

To expand upon newt's response, it is a logical operator, in the same vein as AND and OR. Here is a hastily constructed truth table:

| p | q || p AND q | p OR q | p XOR q
------------------------------------
| 0 | 0 ||    1    |    0   |    0
| 0 | 1 ||    0    |    1   |    1
| 1 | 0 ||    0    |    1   |    1
| 1 | 1 ||    1    |    1   |    0

Basically, XOR says if either p OR q is true, but not both, then the result is true, otherwise it's false.

EDIT: newt already updated his post with a link, and i forgot the forum is displayed in non-fixed font, so blahWastrel2011-11-01 17:31:11
Don't see the fnords and they won't eat you!
B
74
S
16
G
12
Posts: 322
Reputation: 11,583

### » Tue Nov 01, 2011 6:18 pm

oh GOD, my brain will burn.

figuring out how to use it in a good way later.

Thanks @newt and @Wastrel
B
92
S
18
G
12
Posts: 1,166
Reputation: 18,090

### » Tue Nov 01, 2011 6:21 pm

It's easy.

0 XOR 0 = 0
1 XOR 0 = 1
0 XOR 1 = 1
1 XOR 1 = 0

It means "EXCLUSIVE OR", so it is only true if only one is true, not both.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

### » Tue Nov 01, 2011 6:22 pm

@Wastrel: 0 AND 0 is 0, not 1! Otherwise, good table :)
Scirra Founder
B
355
S
208
G
71
Posts: 22,829
Reputation: 176,664

### » Tue Nov 01, 2011 7:55 pm

I have always been interested in what these obscure logical operators would ever be used for...
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

### » Tue Nov 01, 2011 8:19 pm

[QUOTE=Ashley] @Wastrel: 0 AND 0 is 0, not 1! Otherwise, good table :)[/QUOTE]

Then my table is neither truthful NOR logical!
Don't see the fnords and they won't eat you!
B
74
S
16
G
12
Posts: 322
Reputation: 11,583