TYL PROGRAMMING LANGUAGE
▶ BOOLEANS
Boolean variable has only two optional values: TRUE and FALSE.
To declare a boolean variable, write:
issolid \t
isliquid \f
Tyl Symbolizer will replace '\t' with '' (the TRUE symbol), and '\f' with '' (the FALSE symbol):
issolid
isliquid
If you want to change the value of a boolean variable to its opposite value, use the not system function:
issolid \t
isliquid not issolid
In line 'isliquid not issolid', isliquid variable gets the result of the negation of issolid variable.

There are some boolean operators that can be applied to boolean variables. AND operation will yield the result TRUE, if both variables are TRUE.

AND operation:
issolid \t
isblue \t
issolidandblue issolid * isblue
The multiply operator '*', is used as the AND operator for boolean variables.

OR operation will yield the result TRUE, if at least one variable is TRUE.

OR operation:
issolid \t
isblue \f
issolidorblue issolid + isblue
The plus operator '+', is used as the OR operator for boolean variables.

In Tyl we use also the divide operator '/', to make a special boolean operation ANDNOT.

The operation A ANDNOT B:
issolid \t
isblue \f
issolidbutnotblue issolid / isblue
Here's Move Colors program:
isred \t
isgreen \f
isblue \f
go:
print getcolor
moveright
print getcolor
moveright
print getcolor
moveleft
print getcolor
moveleft
print getcolor
moveleft:
temp isred
isred isgreen
isgreen isblue
isblue temp
moveright:
temp isblue
isblue isgreen
isgreen isred
isred temp
getcolor:
isred ?
  'RED'
  \
  isgreen ?
   'GREEN'
   \
   'BLUE'
  ^
^
RED
GREEN
BLUE
GREEN
RED