Boolean or Bool
Description
true
orfalse
Represented also as
1
(true) or0
(false)Whether it’s capitalized depends on the language
Great for control and sensors
Examples:
Processing:
C#
JavaScript
Python:
Shortcut
Using an exclamation mark ( !
) at the beginning of a boolean variable name is short for “the opposite” of the variable
This does not update the variable.
Examples:
Processing and Java-based example:
C# example:
This "shortcut" might not exist in Python.
Last updated