Page 68 - Touchcode_C8_Flipbook
P. 68

Coding in Minecraft







                                             Create a staircase by using a while loop

                   In this task, you will create a block of stairs by using ‘While’ loop that will run 10 times so
                   the height of the stairs will be 10 blocks and the width will be three blocks.

                   You will learn to implement the task with block code using minecraft education edition.

                   To perform the task, follow these steps:

                   Step 1:  Visit the link, https://minecraft.makecode.com/

                   Step 2:  Click on ‘New Project’. Write the name of your project as
                             ‘Create a staircase using While loop’ and click on Create.

                   Step 3:  Click on the ‘Variable’, select ‘Make a Variable...’.

                   Step 4:  Write the name of the variable ‘Size’, and click on ‘Ok’.

                   Step 5:  Variable ‘Size’ will appear as:

                   Step 6:  Change the value of ‘set size to 0’ to 10, and drop it to ‘on
                             start’ block.

                   Step 7:  From ‘Builder’ block, select the ‘builder teleport to’ block.
                             Drop the block to ‘on start’ block.













                   Step 8:  From ‘Loop’ select the ‘while loop’.
                   Step 9:  From ‘Logic’ select the ‘comparison’ operator.

                   Step 10: Move the ‘comparison’ block to ‘While’ block.

                   Step 11: From ‘Variable’ drag the ‘size’ block and drop it to first ‘0’ of ‘comparison’ block in

                             ‘while’ loop.










                   66     Touchcode-VIII
   63   64   65   66   67   68   69   70   71   72   73