Page 83 - Trackpad_ipro 4.1_Class6
P. 83

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


                 The forever block is used to run a set of instructions continuously until 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
                 user. The script for the sprite can be like this (using the Repeat Until block). Following is the
                 script for displaying table of a number:




















                 The output of the program will be similar to this.
















                 You can also use the forever and repeat blocks with if...then block.
                 Let us make a small script. Change the sprite to butterfly and change the backdrop to flowers.


























                                                                          Scratch Programming—Game Creation      81
   78   79   80   81   82   83   84   85   86   87   88