06-24-2003, 10:06 AM
Here's mine, to turn a switch on if off, or off if on, without using XOR. x = 1 if on, and 0 if off.
Though I suspect there may be an easier way, the logical (x=0) may be a hint to others about other algos.
EDIT: Aah. I've just seen Moneo's other way in the XOR thread. But my way still works.
Code:
x = ((x = 0) AND 1) OR (1 AND (X = 0))
Though I suspect there may be an easier way, the logical (x=0) may be a hint to others about other algos.
EDIT: Aah. I've just seen Moneo's other way in the XOR thread. But my way still works.