In order to represent the yes/no nature of condition phrases, we need a special type of value called a
Boolean (named after the great logician George Boole). There are only two possible boolean values: true
and false (which correspond to "yes" and "no"). These are represented in Snap! by the blocks
and
. Blocks that report true or false are called "predicates."
These functions represent the yes/no questions we were discussing earlier. Predicate functions in Snap! will
always have the pointed, hexagonal shape (like this:
).
Let's take a look at a few simple predicates that are built in to Snap! Most of these can be found on the green "operators" tab.