The Boolean Data Type is used to represent logic. There are exactly two valid values (literals) for booleans: True and False. Booleans can be used in Expressions. Boolean expressions cannot contain Integers, Floats or Strings.
The short syntax structure uses the word BOOL:
NEW BOOL VARIABLE = VALUEThe long syntax structure uses the word BOOLEAN:
NEW BOOLEAN VARIABLE EQUAL TO VALUENEW BOOL x = TRUE
PRINTLN x // Displays "TRUE"NEW BOOL x = TRUE
NEW BOOL y = x
PRINTLN y // Displays "TRUE"NEW BOOL x = 5 > 10 // This line asks the queston: Is 5 GREATER THAN 10?
PRINTLN x // Displays "FALSE"PRINTLN 5 > 10 // This line asks the queston: Is 5 GREATER THAN 10? (FALSE)
PRINTLN 5 < 10 // This line asks the queston: Is 5 LESS THAN 10? (TRUE)
PRINTLN 5 == 10 // This line asks the queston: Is 5 EQUAL TO 10? (FALSE)
PRINTLN 5 != 10 // This line asks the queston: Is 5 NOT EQUAL TO 10? (TRUE)NEW BOOL x = 1 // Runtime error! Cannot assign Integer Literal to Boolean Data Type
PRINTLN x // This line is not executed because the program crashed!NEW BOOL x = 1.0 // Runtime error! Cannot assign Float Literal to Boolean Data Type
PRINTLN x // This line is not executed because the program crashed!NEW BOOL x = "TRUE" // Runtime error! Cannot assign String Literal to Boolean Data Type
PRINTLN x // This line is not executed because the program crashed!