and¶
Syntax¶
Parameters¶
boolean_expression:- A numeric expression that is to be evaluated as truthy or falsey.
Returns¶
Returns 1 (true) if both expression parameters are truthy. Returns
0 (false) otherwise.
Description¶
This is a logical conjunction action.
The and action employs short-circuit
evaluation: if the
first argument is false, the second argument is not evaluated.
Truthy and Falsey Values¶
Like in many programming languages, FRED's numeric expressions can be evaluated as either true or false. Values that evaluate to true are considered "truthy", and values that evaluate to false are considered "falsey".
In FRED, a value of 0 is falsey, and all non-zero values are truthy.
Examples¶
The above moves all agents in their twenties to the stateSelected.