Page 90 - 2403_Trackpad_V5.1_C3_Fb
P. 90

LOOPS


                  All the programs or projects developed till now ran only once. If you want to run a

                  set of statements more than once, you will either run the code again or write the
                  script again. In Scratch, we can save our time and effort by repeating the code
                  without writing the program again or writing the script again. The automatic running
                  of a set of instructions more than once is called looping. The blocks for looping are
                  given in Control category.                                                               repeat  10


                  The Repeat block is used to run a set of instructions for a specified
                  number of times.

                  The  Repeat until block is used  to  run  a set  of instructions  till a            repeat  until
                  condition is satisfied.

                  The Forever block is used to run a set of instructions continuously until                forever

                  stopped. The instructions inside this block will be executed in a loop
                  until the Stop button          is clicked by the user.

                  The  Repeat and Repeat  Until blocks  can be
                  used to display the table of a number input by                  The circle is the only shape

                  the user. The script for the sprite can be like                    with a constant width.
                  this (using Repeat Until block).









































                   88   Premium Edition-III
   85   86   87   88   89   90   91   92   93   94   95