Page 115 - CG_v2.1_flipBooks_class_5
P. 115

Turning Turtle Left or Right

                 By default, turtle is facing towards the right side. We can change the degree value to change
                 the heading direction.

                 A turtle can be turned in two directions: clockwise (right) or anti-clockwise (left).












                                 Clockwise (Right)                              Anti-Clockwise (Left)

                 There are two blocks that can be used to turn turtles:






                          This can turn the turtle right                     This can turn the turtle left
                    or clockwise by some degrees, say '90'.         or anti-clockwise by some degrees, say '90'.
                 Turning a Turtle


                 To turn a turtle in AI Connect, follow the given steps:
                 Step 1   Create a new variable ‘T’ from the Variables category. Add set T to block in the
                           script area.
                 Step 2   Add create new turtle block, from the Turtles blocks under Draw category, inside
                           the set T to block.

                 Step 3   Attach make turtle pen-down block from the Control block under the Draw category.

                 Step 4   Attach make turtle move forward by block from the Motion block under the Draw
                           category and enter input value 100.
                 Step 5   Attach  make  turtle  turn  left  by  block  from  the  Motion  block  under  the  Draw
                           category and enter input angle 90.
                 Step 6   Click on the Run button.























                                                                                Angles and Value Conversion   113
   110   111   112   113   114   115   116   117   118   119   120