LessThanOrEqual
Integer
≤ (Less Than or Equal To)
The ≤
node compares two integer inputs and outputs a boolean value indicating whether the first input is less than or equal to the second input.
Inputs
a
(integer): The first integer to compare. Default value is 0.b
(integer): The second integer to compare. Default value is 0.
Outputs
result
(boolean): True ifa
is less than or equal tob
, false otherwise.
Configuration
This node has no configuration options.
Usage
To use the ≤
node:
- Connect integer values to the
a
andb
input ports. These can be hardcoded values, or outputs from other nodes. - The node will output a boolean value to the
result
port, which you can then use as input to other nodes or as a final output of your spell.
Example
Suppose you want to check if a user’s age is less than or equal to 18 in order to determine if they are a minor. You could use the ≤
node like this:
- Connect the user’s age (e.g., from a form input or database) to the
a
port. - Connect the integer value 18 to the
b
port. - The
result
port will outputtrue
if the user’s age is less than or equal to 18,false
otherwise. - Connect the
result
to a branch node to conditionally execute different parts of your spell based on whether the user is a minor.
Here’s what that might look like in a simple spell:
Best Practices
- Ensure that the inputs to
≤
are actually integers. Connecting other data types may lead to unexpected behavior. - Remember that
≤
is inclusive of the second input value. If you want strict less than comparison, use the<
node instead.
Common Issues
- Accidentally connecting the inputs in the wrong order. Remember, the node checks if
a
is less than or equal tob
, not the other way around. - Forgetting to handle both the
true
andfalse
cases in your spell logic. Make sure you consider what should happen in each case.