Sprite Lab Documentation

=
Category:Logic

Gets the result of an expression that compares two values.

This block determines if the comparison of two values is true. For example, the comparison expression 3 < 4 is true, while the expression 3 > 4 is false. This block should only be used in other logic blocks.

Examples

Example 1

This fish is only afraid of bears whose size is greater than 90. Press space to make a bear appear and see what the fish does.

Example 2

Click on the gold coin, and the green critter will guess a random number between 1 and 25. If the green critter guesses a number that is higher than the one the princess critter was thinking of, he will get her gold coin!

Syntax

logic_compare

Parameters

NameTypeRequired?Description
value 1

Variable, number, color, text, or logic block to be compared with value 2

operator

Allows the two values to be compared: = ≠ < ≤ >≥

value 2

Variable, number, color, text, or logic block to be compared with value 1

Found a bug in the documentation? Let us know at support@code.org.