## Booleans

- true or false These primitives (also called predicates) end in a '?' and return either 'True' or 'False'.

Primitive Alt Action
Before? aa bb
Empty? "name
EndCountDown?
Equal? aa bb
Integer? nn
Key?
List? :var
Member? "aa :bb
Mouse?
Number? nn
PenDown?
Primitive? "name
Procedure? "name
Variable? "name
Visible?
Word? :var

PD?
Prim?
Proc?
Var?

Return true if aa is before bb, else false.
Return true if "name is an empty word or list, else false.
Return true if the countdown has reached 0, else false. T&D.
Return true if aa and bb are equal, else false.
Return true if nn is an integer (whole number), else false.
Return true if a key has been pressed, then resets to false.
Return true if :var is a list, else false.
Return true if "aa is a member of :bb, else false.
Return true if mouse moved or pressed, then resets to false.
Return true if nn is a number, else false.
Return true if the pen is down, else false.
Return true if "name is an XLogo primitive, else false.
Return true if "name is a user defined procedure, else false.
Return true if "name is defined as a variable, else false.
Return true if the turtle is visible, else false.
Return true if :var is a word, else false.

Booleans can be operated on by:

Primitive Action
And aa bb
Or
aa bb
Not aa
Return true if both aa and bb is true, else false.
Return true if either aa or bb is true, else false.
Return not aa. If aa is true return false. If aa is false return true.
True
False
Return "true.
Return "false.

Note

1. Before? can test either numerical or alphabetical values.
Equal? can test either numerical or alphabetical values, or a list.
2. And and Or can be used within brackets to test more than two conditions. Eg. If (And 1=1 2=2 3=3) [Print "True] 