Knowledge Base

Change Variable Block

spike_robot.jpg This block works for SPIKE Prime 

Note: this block is only available in the CoderZ Adventure: New Worlds course.

The Change Variable block allows you to change the value of an integer and double type variable that you have already declared. The initial value of the variable is first set by the Declare Variable block. The change can be positive or negative, as specified in the blue number block.

Example Program

In this program, the Change Variable block causes the value of the drive_distance variable to decrease by 2 each iteration of the loop.

 

See also:

Declare Variable Block 

Variable Block

Was this article helpful?
0 out of 0 found this helpful

Comments

Please sign in to leave a comment.