Step 2

Now that we have our variable setup, we can add the main body of our code to our procedure. We are going to start with a loop that checks against a condition and a block placement function. Grab the “while” loop from Logic and loops. Our condition is that we want the pillar to be 4 blocks tall. To do this add a conditional block from Logic operations. (Be sure you get the block that is the same shade of blue as the previous blocks, this is so we can compare numbers)

Next, grab a “Place” block from Block procedures. We have to manually set the block that’s going to be placed by double clicking on the empty square in the place function. To get the addition block, go into the Math section.

We also add a piece of code at the end of our loop that will add 1 to the current value of “y2” so that the loop can end as well as add 1 to the Y value. That will allow the blocks to be placed in a vertical arrangement.