Page 64 - Computing E-Book Grade 3
P. 64

The City School  2021-2022





           Your code should look like this:



           FORWARD 100

           RIGHT 90
           FORWARD 100

           RIGHT 90
           FORWARD 100

           RIGHT 90
           FORWARD 100


           4.4. REPEAT Command


           In the previous section, we created a square using individual commands. If you observe

           closely, most of the instructions were the same. We can create a square using REPEAT
           command as well.



                      Procedure                               Example                         Description

         REPEAT number [instructions]            REPEAT 4 [FORWARD                     The turtle does the
                                                 100RIGHT 90]                          following four times:

                                                                                       moves forward 100, turns
                                                                                       right 90°.



           With the REPEAT command, we can draw a square with just one instruction.





































                                                                                                              64
   59   60   61   62   63   64   65   66   67   68   69