Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 93 - 2612_Digimind
P. 93

    Look at these polygons that can be made using the repeat block.

                                Polygon                                    Command

                      Triangle                          Repeat 3 [Move 100 Steps → Turn 120 degrees]

                      Square                           Repeat 4 [Move 100 Steps → Turn 90 degrees]

                      Pentagon                          Repeat 5 [Move 100 Steps → Turn 72 degrees]

                      Hexagon                          Repeat 6 [Move 100 Steps → Turn 60 degrees]

                      Heptagon                         Repeat 7 [Move 100 Steps → Turn 51 degrees]

                      Octagon                           Repeat 8 [Move 100 Steps → Turn 45 degrees]

                      Nonagon                          Repeat 9 [Move 100 Steps → Turn 40 degrees]

                      Decagon                          Repeat 10 [Move 100 Steps → Turn 36 degrees]

                     To draw polygons in Scratch, you must remember three points:

                        You must know the number of sides in the shape. This is the value to be given in repeat
                        block.
                       Each time a repeat command is used, you draw a line and turn at a corner.

                        You must know the degree of the angle at the corner. It is very easy to calculate this.

                        Just divide 360 by the number of sides in the shape.

                     Drawing a Square With and Without Using Repeat Block
                     Create the given Script and observe the sprite moving and turning only four times to draw

                                                                                         clicked  block to draw a square
                     a square using repeat block. Click four times on the  when
                     without using repeat block.

                               when  clicked                              when  clicked
                                   pen down                                   pen down

                               repeat  4                                      set pen color to
                                move 100  steps                               change pen size by  5
                                                                          move  50  steps
                                turn  90  degrees
                                                                          turn  90  degrees

                     Drawing A Circle

                     To draw a circle, create the given script in Scratch.

                                                                                             Drawing Shapes in Scratch  91

| 88 89 90 91 92 93 94 95 96 97 98 |