XOR - What it mean?

Get help using Construct 2

Post » 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
Image
B
103
S
23
G
17
Posts: 1,348
Reputation: 21,969

Post » 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
Image ImageImage
B
165
S
49
G
147
Posts: 8,047
Reputation: 96,586

Post » 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
79
S
17
G
12
Posts: 323
Reputation: 11,840

Post » 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
Image
B
103
S
23
G
17
Posts: 1,348
Reputation: 21,969

Post » 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,170

Post » Tue Nov 01, 2011 6:22 pm

@Wastrel: 0 AND 0 is 0, not 1! Otherwise, good table :)
Scirra Founder
B
382
S
223
G
86
Posts: 23,994
Reputation: 189,745

Post » Tue Nov 01, 2011 7:55 pm

I have always been interested in what these obscure logical operators would ever be used for...
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,644

Post » 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
79
S
17
G
12
Posts: 323
Reputation: 11,840


Return to How do I....?

Who is online

Users browsing this forum: BackendFreak, imhotep22 and 4 guests