An interesting use of xor is for switching. If we have a bool variable, and
we xor it with 0, what happens?
0 ^ 0 = 0
1 ^ 0 = 1
The result is the same as the original before we xor'd it. But if we xor it
with a 1:
0 ^ 1 = 1
1 ^ 1 = 0
The result is exactly opposite of the original. So we can use this to
either leave a bit alone, or switch it over to the other state. It becomes
a way to flip a switch, or change a flag or state.
The other functions, & and  do things like this as well. With AND, if we
use a 1:
0 & 1 = 0
1 & 1 = 1
The original state is preserved, but if we use a 0:
0 & 0 = 0
1 & 0 = 0
The result is always 0. It can be used to turn something off, or set it to
zero, or even be thought of as allowing/disallowing the state of the bit to
show through.
With OR, if we use a 0:
0  0 = 0
1  0 = 1
The original is once again showing through normally. But if we use a 1:
0  1 = 1
1  1 = 1
The result is always on, or set to 1.
