Properties:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
aidsIn |
function | The Array class Properties
|
- Source:
Methods
(static) and_multi(…inputs) → {boolean}
Execute an AND (this AND that AND ...) gate with more than 2 inputs. Returns true only if all inputs are true.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
inputs |
BooleanValue |
<repeatable> |
The inputes to the AND gate. |
- Source:
Returns:
Whether all inputs were true.
- Type
- boolean
Example
Boolean.and_multi(false, true, true, true); // false
Boolean.and_multi(true, true, true); // true;
(static) nand(a, b) → {boolean}
Simulate an NAND gate NOT(this AND that)
Parameters:
Name | Type | Description |
---|---|---|
a |
BooleanValue | The first input. |
b |
BooleanValue | The second input |
- Source:
Returns:
The resulting value.
- Type
- boolean
Example
Boolean.nand(false, true); // true
Boolean.nand(false, false); // true
Boolean.nand(true, true); // false
(static) nand_multi(…inputs) → {Boolean}
run an NAND gate with more than 2 inputs. Returns true so long as at least one argument is false.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
inputs |
BooleanValue |
<repeatable> |
The inputs to give to the AND gate. |
- Source:
Returns:
Whether at least one input was false.
- Type
- Boolean
Example
Boolean.nand_multi(true, true, false); // true
Boolean.nand_multi(true, true, true); // false
(static) nor(a, b) → {boolean}
Runs an NOR gate. Returns true only if all of the inputs are false.
Parameters:
Name | Type | Description |
---|---|---|
a |
BooleanValue | The first input. |
b |
BooleanValue | The second input. |
- Source:
Returns:
The result.
- Type
- boolean
Example
Boolean.nor(false, false); // true
Boolean.nor(true, false); // false
(static) nor_multi(…inputs) → {boolean}
Runs an NOR gate. Returns true only if all of the inputs are false.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
inputs |
BooleanValue |
<repeatable> |
The inputs. |
- Source:
Returns:
The result.
- Type
- boolean
(static) xnor(a, b) → {boolean}
Runs an XNOR gate. Returns true only if all inputs are both true or false.
Parameters:
Name | Type | Description |
---|---|---|
a |
BooleanValue | The first input. |
b |
BooleanValue | The second input. |
- Source:
Returns:
The result.
- Type
- boolean
Example
Boolean.xnor(true, false); // false
Boolean.xnor(false, false); // true
Boolean.xnor(true, true); // true
(static) xnor_multi(…inputs) → {boolean}
Runs an XNOR gate with more than 2 inputs. Returns false only if one input is true.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
inputs |
BooleanValue |
<repeatable> |
The inputs to take. |
- Source:
Returns:
The result.
- Type
- boolean
Example
Boolean.xnor_multi(false, false, false); // true
Boolean.xnor_multi(false, true, false); // false
Boolean.xnor_multi(false, true, true); // true
Boolean.xnor_multi(true, true, true); // true
(static) xor(a, b) → {boolean}
run an XOR gate with 2 inputs.
Parameters:
Name | Type | Description |
---|---|---|
a |
BooleanValue | The first input. |
b |
BooleanValue | The second input. |
- Source:
Returns:
The result.
- Type
- boolean
Example
Boolean.xor(true, false); // true
Boolean.xor(true, true); // false
Boolean.xor(false, false); // false;
(static) xor_multi(…inputs) → {boolean}
Runs an XOR. Returns true if only one input is true.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
inputs |
BooleanValue |
<repeatable> |
The inputs to run the XOR with. |
- Source:
Returns:
The result of the muli-xor.
- Type
- boolean
Example
Boolean.xor_multi(false, false, false, true); // true
Boolean.xor_multi(true, false, true, false); // false