Page 130 - Touchpad_Plus_V3.2_Class 8
P. 130

For example:

                  Robby has to paint these blank boxes to make a letter ‘U’
                   Start                         Start
                                                                                 Just as plants need sunlight to
                                                                               produce glucose, algorithms need
                                                                                right data to generate optimum
                                                                                              results.




                  The program will be


                         Move 1 down and Fill Colour                        Repeat 4 times
                         Move 1 down and Fill Colour                        (Move 1 down and Fill Colour)
                         Move 1 down and Fill Colour
                         Move 1 down and Fill Colour                        Repeat 2 times
                         Move 1 right and Fill Colour                       (Move 1 right and Fill Colour)
                         Move 1 right and Fill Colour
                         Move 1 up and Fill Colour                          Repeat 3 times
                         Move 1 up and Fill Colour                          (Move 1 up and Fill Colour)
                         Move 1 up and Fill Colour


                              Program without a loop                               Program with a loop


                  Look at another examples:

                  1.   Move 1 step down                                       St

                       Repeat 6 times

                       (

                       Fill color

                       Move 1 right
                       )



                  2.                                                          St
                       Repeat until reached  last
                       column
                       (

                       Fill color

                       Move 1 right

                       )





               128      Plus (Ver. 3.2)-VIII
   125   126   127   128   129   130   131   132   133   134   135