Module Logic
N-Argument logic operators.
Module Status: Experimental 2020-10-31.
Usage:
local Logic = require('__eradicators-library__/erlib/factorio/Logic')()
Basic
And(...) | And-compares an arbitrary number of objects for truthyness. |
Or(...) | Or-compares an arbitrary number of objects for truthyness. |
Xor(...) | Exclusive-Or-compares an arbitrary number of objects for truthyness. |
Advanced
Andy(...) | And-compares an arbitrary number of objects for truthyness. |
Ory(...) | Or-compares an arbitrary number of objects for truthyness. |
Xory(...) | Exclusive-Or-compares two objects for truthyness. |
Basic
- And(...)
-
And-compares an arbitrary number of objects for truthyness.
Parameters:
- ...
Returns:
-
boolean
True if all objects were truthy.
- Or(...)
-
Or-compares an arbitrary number of objects for truthyness.
Parameters:
- ...
Returns:
-
boolean
True if at least one object was truthy.
- Xor(...)
-
Exclusive-Or-compares an arbitrary number of objects for truthyness.
Parameters:
- ...
Returns:
-
boolean
True if exactly one object was truthy.
Advanced
Advanced functions return one of the objects instead of boolean.
- Andy(...)
-
And-compares an arbitrary number of objects for truthyness.
Parameters:
- ... AnyValue
Returns:
- Ory(...)
-
Or-compares an arbitrary number of objects for truthyness.
Parameters:
Returns:
-
AnyValue
The first truthy object if
Logic.Or(...)
would've been true. - Xory(...)
-
Exclusive-Or-compares two objects for truthyness.
Parameters:
- ... AnyValue
Returns: