Xor is one of the only commands (except for the graphing commands; I'm only in 8th grade) I've never used. It's pretty irritating.
One approach you can try is using conditions in the form of sentences. For example, "I can either go to Disney World or Disney Land, but not both." In this sentence, the only destination options are Disney World and Disney Land, and you can only go to one or the other.
I have a more morbid way of explaining it…teehee!:
You are in a room with two big cables. If you hold one cable, you are fine and you can continue with the rest of your life (code). If you hold the other cable, you are still fine and can live on (continue code). However, if you hold both cables at the same time, an electric current completes and a laser that is pointing right at your face (forgot to mention that =p) is activated and it blows a hole through your head nd you start bleeding to death and organs fall out and you wither in severe pain for the lat millisecond of your entire life before you collapse and rot into a pile of mold and die, and your soul gets trapped forever!!!!!! Muahahaha!!!!!
Oh, and if hold no cables, it shoots you anyway, cuz it gets bored (no conditions are true).
No…I am not on crack….teehee!
You forgot to mention that you also die if you don't hold a cable ;)
I have to say, I have never ever needed to use the xor command. And frankly, I can't see a situation where you would.
Cheers ~ James Kanjo
Well, first of all, you can use it instead of or a lot of the time (when it doesn't matter either way). I guess this isn't what you're looking for…
Off the top of my head, xor is useful in writing a strategy for Nim. The only incidental use I've seen is here. I agree such cases are rare, but maybe they'd be less rare if we thought of xor more immediately.
I used it to see if a point (X,Y) was inside a box made by 2 points (Each point is a corner). (A,B) (C,D)
If (X>A xor X>C) and (Z>B xor Z>D)
then the point is inside the box
This makes sure that neither point AB or point CD has to come first, it works in any situation.