Scripting reference · Nerdamer Language

xor

Returns 1 when an odd number of arguments are true.

Every argument is evaluated.

Scripting

xor(a, b, ...)

Write it in a script: nerdamer('xor(1,1,1)'), or in the Playground.

Parameters

a, b, ...
Two or more conditions or values.

Examples

Three true arguments: odd.

xor(1,1,1)
// → 1
Open in Playground

Two true arguments: even.

xor(1,1)
// → 0
Open in Playground

Good to know

  • A value is true when it isn't zero. An unknown symbol counts as true; a comparison that can't be decided, such as x>0 for an unknown x, counts as false.

← Back to Nerdamer Scripting