Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 110 - 2609_Logicode
P. 110

    iteration and the control jumps to the beginning of the loop for the next iteration. The loop’s
                      condition is checked again and if it is true, then the control enters the loop, otherwise the control
                      will be moved to the statement immediately after the loop. For example, if you want to skip certain
                      values but continue looping, you use continue.

                      Let us create a project in MakeCode Arcade that demonstrate the use of continue block. Prepare
                      the project in MakeCode Arcade to display the numbers 0 to 9 but as soon as it reaches 3 it exits
                      from the loop as shown below:

                      Now, click on the A button in the Game Controls to view the output of last iteration of the for loop.

                      Notice that, when the index value is 3, the loop skip the current iteration and display the output of
                      other iterations of the while loop.

                      108   Premium Edition-VIII

| 105 106 107 108 109 110 111 112 113 114 115 |