What is the simplest way to do a three-way exclusive OR?
In other words, I have three values, and I want a statement that evaluates to true IFF only one of
f= lambda{ |a| [false, false, true].permutation.to_a.uniq.include? a } p f.call([false, true, false]) p f.call([false, true, true])
$ true $ false
$ true
$ false
Because I can.