Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 112 - 2611_SmartGPT Pro V(5.0) C-4
P. 112

    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

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

                            when  clicked                                 when  clicked
                                pen down                                      pen down
                            repeat  4                                         set pen color to
                              move 100   steps                                set to pen size 5
                              turn   90  degrees                          move 50   steps
                                                                          turn    90  degrees

                      Drawing A Circle

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

                                           when  clicked
                                               pen down
                                               set pen size to 5
                                           repeat 360
                                             move 1   steps
                                             turn   1  degrees
                                                 Change pen color    by  5

                          PURE         In Scratch, each number is equal to 1 step  of the sprite on the stage. In the turn block,

                           FACT        change the degree from 15 to 90.

                      FOREVER BLOCK
                      Forever block is used to make the sprite do something infinitely (nonstop) until a command

                      is passed over it by the user. To use the Forever block, replace the repeat block with a forever
                      block. Create the following Script and Run to watch your Sprite go round and round!

                                when    clicked
                                      pen down
                                 forever                                    The circle is the only shape with a
                                   move 100      steps                              constant width.

                                   turn     90  degrees

                      110   Computer Science (V5.0)-IV

| 107 108 109 110 111 112 113 114 115 116 117 |