Operators#

Add#

The Add block is used to add any two values together and reports the sum.

A green, rounded block from a visual programming interface, featuring two input fields with the number '0' in each, separated by a plus sign ('+') in the center. This block represents an addition operation where two values are summed.

The Add block can accept decimals, integers, or numeric blocks.

The Add block fits in blocks that accept circular spaces, and can accept other circular blocks in it as well.

In this example, the 123 Robot will move forward for 30 mm.

A visual programming block sequence starting with a yellow 'when started' block. Attached to it is a blue 'drive forward for' block. Inside the block, the distance is specified by a green, rounded addition block, which contains two input fields with the values '10' and '20', separated by a plus sign ('+'). The unit of measurement is set to 'mm', indicating the robot will drive forward for the sum of these two distances, which is 30 mm.

Subtract#

The Subtract block is used to subtract one value from another and reports the difference.

A green, rounded block from a visual programming interface, featuring two input fields with the number '0' in each, separated by a minus sign ('-') in the center. This block represents a subtraction operation where one value is subtracted from another.

The Subtract block can accept decimals, integers, or numeric blocks.

The Subtract block fits in blocks that accept circular spaces, and can accept other circular blocks in it as well.

In this example, the 123 Robot will move forward for 20 mm.

A visual programming block sequence starting with a yellow 'when started' block. Attached to it is a blue 'drive forward for' block. Inside the block, the distance is specified by a green, rounded subtraction block, which contains two input fields with the values '30' and '10', separated by a minus sign ('-'). The unit of measurement is set to 'mm', indicating the robot will drive forward for the result of this subtraction, which is 20 mm.

Multiply#

The Multiply block is used to multiply any two values together and reports the product.

A green, rounded block from a visual programming interface, featuring two input fields with the number '0' in each, separated by an asterisk ('*') in the center. This block represents a multiplication operation where two values are multiplied together.

The Multiply block can accept decimals, integers, or numeric blocks.

The Multiply block fits in blocks that accept circular spaces, and can accept other circular blocks in it as well.

In this example, the 123 Robot will move forward for 20 mm.

A visual programming block sequence starting with a yellow 'when started' block. Attached to it is a blue 'drive forward for' block. Inside the block, the distance is specified by a green, rounded multiplication block, which contains two input fields with the values '2' and '10', separated by an asterisk ('*'). The unit of measurement is set to 'mm', indicating the robot will drive forward for the result of this multiplication, which is 20 mm.

Divide#

The Divide block is used to divide the first value by the second value and reports the dividend.

A green, rounded block from a visual programming interface, featuring two input fields with the number '0' in each, separated by a division symbol ('/') in the center. This block represents a division operation where one value is divided by another.

The Divide block can accept decimals, integers, or numeric blocks.

The Divide block fits in blocks that accept circular spaces, and can accept other circular blocks in it as well.

In this example, the 123 Robot will move forward for 20 mm.

A visual programming block sequence starting with a yellow 'when started' block. Attached to it is a blue 'drive forward for' block. Inside the block, the distance is specified by a green, rounded division block, which contains two input fields with the values '100' and '5', separated by a division symbol ('/'). The unit of measurement is set to 'mm', indicating the robot will drive forward for the result of this division, which is 20 mm.

Random#

The Random block is used to report a random value between the lowest and highest values in the block.

A green, rounded block from a visual programming interface labeled 'pick random.' The block contains two input fields with the values '1' and '10,' separated by the word 'to.' This block represents a function that picks a random number between the specified range of 1 to 10.

The Random block can accept decimals, integers, or numeric blocks.

In this example, the 123 Robot will move forward for a random distance between 10 and 30 mm.

A visual programming block sequence starting with a yellow 'when started' block. Attached to it is a blue 'drive forward for' block. Inside the block, the distance is specified by a green, rounded block labeled 'pick random,' which contains two input fields with the values '10' and '30,' separated by the word 'to.' The unit of measurement is set to 'mm,' indicating the robot will drive forward for a random distance between 10 mm and 30 mm.

Greater than#

The Greater than block is used to report if the first value is larger (greater) than the second value.

A green, diamond-shaped block from a visual programming interface featuring two input fields with the values '50' and '0,' separated by a greater-than symbol ('>'). This block represents a comparison operation where the first value, 50, is checked to see if it is greater than the second value, 0.

The Greater than block can accept decimals, integers, or numeric blocks.

The Greater than block reports True when the first value is larger than the second value and False when the first value is smaller than or equal to the second value.

The Greater than Boolean block reports a true or false value and fits in blocks with hexagonal (six-sided) spaces.

In this example, the 123 Robot will move in forward for 3 steps, because 50 > 0 returns True.

A visual programming block sequence that begins with a yellow 'when started' block. Below it is a yellow 'if-then' block with a condition. The condition is a green, diamond-shaped comparison block that checks if '50 > 0.' If the condition is met, the first action is to 'drive forward for 3 steps' using a blue block. This sequence will cause the robot to move forward if the condition is true.

Less than#

The Less than block is used to report if the first value is less (smaller) than the second value.

A green, diamond-shaped block from a visual programming interface featuring two input fields with the values '0' and '50,' separated by a less-than symbol ('<'). This block represents a comparison operation where the first value, 0, is checked to see if it is less than the second value, 50.

The Less than block can accept decimals, integers, or numeric blocks.

The Less than block reports True when the first value is smaller than the second value and reports False when the first value is greater than or equal to the second value.

The Less than Boolean block reports a true or false value and fits in blocks with hexagonal (six-sided) spaces.

In this example, the 123 Robot will move forward for 20 mm, because 0 < 50 returns True.

A visual programming block sequence that begins with a yellow 'when started' block. Below it is a yellow 'if-then' block with a condition. The condition is a green, diamond-shaped comparison block that checks if '0 < 50.' If the condition is met, the first action is to 'drive forward for 3 steps' using a blue block. This sequence will cause the robot to move forward if the condition is true.

Equal to#

The Equal to block is used to report if the first value is the same as, or equal to, the second value.

A green, diamond-shaped block from a visual programming interface featuring two input fields with the values '0' and '50,' separated by an equal sign ('='). This block represents a comparison operation where the first value, 0, is checked to see if it is equal to the second value, 50.

The Equal to block can accept decimals, integers, or numeric blocks.

The Equal to block reports True when the two values are exactly the same and reports False when the two values are not the same.

The Equal to Boolean block reports a true or false value and fits in blocks with hexagonal (six-sided) spaces.

In this example, the 123 Robot will move forward for 20 mm, because 20 = 20 returns True.

A visual programming block sequence that begins with a yellow 'when started' block. Below it is a yellow 'if-then' block with a condition. The condition is a green, diamond-shaped comparison block that checks if '0 = 50.' If the condition is met, the first action is to 'drive forward for 3 steps' using a blue block. This sequence will cause the robot to move forward if the condition is true.

And#

The And block is used to report if two Boolean conditions are both true.

A green, diamond-shaped block from a visual programming interface labeled 'and.' The block has two open hexagonal slots on either side where additional blocks can be inserted. This block is used to represent a logical 'and' operation, combining two conditions.

The And block reports True when both conditions are true and reports False when one, or both, of the conditions are false.

The And Boolean block reports a true or false value and fits in blocks with hexagonal (six-sided) spaces.

In this example, if the Eye Sensor detects a red object and the 123 Robot is moving at the same time, the 123 Robot will stop moving. Otherwise, the 123 Robot will keep moving forward.

A visual programming block sequence that begins with a yellow 'when started' block. The first action is a blue 'drive forward' block. Below it is a yellow 'wait until' block that contains a condition. The condition includes a green, diamond-shaped 'and' block that combines two sub-conditions. The first sub-condition is a blue block that states 'eye detects red?' and the second sub-condition is another green, diamond-shaped block with the word 'not' in front of a blue block stating 'drive is done?' If both sub-conditions are met, the sequence triggers the next action, which is 'stop driving' using a blue block. This sequence waits for the robot's eye to detect the color red and checks that the drive is not finished before stopping the robot.

Or#

The Or block is used to report if one of two Boolean conditions are true.

A green, diamond-shaped block from a visual programming interface labeled 'or.' The block has two open hexagonal slots on either side where additional blocks can be inserted. This block is used to represent a logical 'or' operation, combining two conditions.

The Or block reports True when one (or both) of the conditions are true and reports False when both of the conditions are false.

The Or Boolean block reports a true or false value and fits in blocks with hexagonal (six-sided) spaces.

In this example, if the Eye Sensor detects a red or green object, the 123 Robot will stop. Otherwise, the 123 Robot will keep moving forward.

A visual coding block sequence that begins with a yellow 'when started' block. The first action is a blue 'drive forward' block. Below it is a yellow 'wait until' block that contains a condition. The condition includes a green, diamond-shaped 'or' block that combines two sub-conditions. The first sub-condition is a blue block that states 'eye detects red?' and the second sub-condition is another blue block that states 'eye detects green?' If either of these conditions is met, the sequence triggers the next action, which is 'stop driving' using a blue block.

Not#

The Not block is used to report the opposite (inverse) of the reported Boolean value.

A green, diamond-shaped block from a visual coding interface labeled 'not.' The block has one open hexagonal slot on the right side where an additional block can be inserted. This block is used to represent a logical 'not' operation, which inverts the condition that is placed inside it.

The Not block reports True when the Boolean block inside reports false and reports False when the Boolean block inside reports true.

The Not Boolean block reports a true or false value and fits in blocks with hexagonal (six-sided) spaces.

In this example, if the Eye Sensor detects a red object and the 123 Robot is moving at the same time, the 123 Robot will stop moving. Otherwise, the 123 Robot will keep moving forward. The Not block is used to check if the 123 Robot is moving, by saying when the 123 Robot is Not done driving.

A visual coding block sequence that begins with a yellow 'when started' block. The first action is a blue 'drive forward' block. Below it is a yellow 'wait until' block that contains a condition. The condition includes a green, diamond-shaped 'or' block that combines two sub-conditions. The first sub-condition is a blue block that states 'eye detects red?' and the second sub-condition is another blue block that states 'eye detects green?' If either of these conditions is met, the sequence triggers the next action, which is 'stop driving' using a blue block.

Round#

The Round block is used to round the inputted value to the nearest integer.

A green, rounded block from a visual coding interface labeled 'round.' The block contains an input field on the right side with the number '0.' This block is used to round the value entered in the input field to the nearest integer.

The Round block can accept decimals, integers, or numeric blocks.

Decimals that are 0.5 or greater round up and decimals less than 0.5 round down.

The Round block fits in blocks that accept circular spaces, and can accept circular blocks in them as well.

In this example, the 123 Robot will move forward for the rounded number of 20 mm.

A visual coding block sequence starting with a yellow 'when started' block. Attached to it is a blue 'drive forward for' block. Inside the block, the distance is specified by a green, rounded 'round' block that contains the value '19.76.' The unit of measurement is set to 'mm,' indicating the robot will drive forward for the rounded value of 19.76 mm, which would be 20 mm.

Function#

The Function block is used to perform a selected math function.

A green, rounded block from a visual coding interface with a dropdown menu labeled 'abs' followed by the word 'of' and an input field containing the number '0.' This block is used to calculate the absolute value of the number entered in the input field.

The Function block can accept decimals, integers, or numeric blocks.

The available functions are:

  • abs - absolute value

  • floor - rounds down to the nearest integer

  • ceiling - rounds up to the nearest integer

  • sqrt - square root

  • sin - sine

  • cos - cosine

  • tan - tangent

  • asin - arcsine or the inverse of sine

  • acos - arccosine or the inverse of cosine

  • atan - arctan or the inverse of tangent

  • ln - the natural logarithm base e

  • log - logarithm base 10

  • e ^ - powers of e

  • 10 ^ - powers of 10

The Function block fits in blocks that accept circular spaces, and can accept circular blocks in them as well.

In this example, the 123 Robot will move forward for 20 mm.

A visual coding block sequence starting with a yellow 'when started' block. Attached to it is a blue 'drive forward for' block. Inside the block, the distance is specified by a green, rounded block with a dropdown menu set to 'abs' (absolute value), followed by 'of' and an input field containing the value '-20.' The unit of measurement is set to 'mm,' indicating the robot will drive forward for the absolute value of -20 mm, which is 20 mm.

Remainder#

The Remainder block is used to divide the first value by the second value and report the remainder.

A green, rounded block from a visual coding interface labeled 'remainder of.' The block contains two input fields with the number '0' in each, separated by a division symbol ('/'). This block is used to calculate the remainder when the first value is divided by the second value.

The Remainder block can accept decimals, integers, or numeric blocks.

Numbers that divide evenly will report a remainder of zero.

The Remainder block fits in blocks that accept circular spaces, and can accept circular blocks in them as well.

In this example, the 123 Robot will move forward for 20 mm.

A visual coding block sequence starting with a yellow 'when started' block. Attached to it is a blue 'drive forward for' block. Inside the block, the distance is specified by a green, rounded 'remainder of' block. This block contains two input fields with the values '100' and '40,' separated by a division symbol ('/'). The unit of measurement is set to 'mm,' indicating the robot will drive forward for the remainder of 100 divided by 40 mm, which is 20 mm.