C Block#

The Switch C Block block is used to loop the blocks within until the condition in the open space of the block is met.

They are shaped to attach stack or other C blocks above, below, or inside them.

Illustration of a C Block in programming, showing its structure for looping commands until a condition is met.

Select the open space of the block indicated in the image here and begin typing.

C Block diagram illustrating the open space for inputting Switch Python commands for looping conditions.

Some possible Switch Python commands to use with the Switch C block include:

  • while

  • if

  • for

In order for a Switch C block to function as intended, the Switch Python commands must be entered with the correct spelling, punctuation, and indentation. Refer to the Help of each block to see the matching Switch Python command.

In this example, when the Left Bumper is pressed, the robot will print “The bumper was pressed!” to the console.

Illustration of a C Block used for looping in programming, with instructions for entering Switch Python commands.