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
ImageImageImageImageImageImage
B
93
S
20
G
13
Posts: 1,217
Reputation: 18,996

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 Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

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
75
S
16
G
12
Posts: 322
Reputation: 11,608

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
ImageImageImageImageImageImage
B
93
S
20
G
13
Posts: 1,217
Reputation: 18,996

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,155

Post » Tue Nov 01, 2011 6:22 pm

@Wastrel: 0 AND 0 is 0, not 1! Otherwise, good table :)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

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
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

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
75
S
16
G
12
Posts: 322
Reputation: 11,608


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 20 guests