BFOIT - Introduction to Computer Programming

Commanding a Turtle

   Welcome to BFOIT's Introduction to Computer Programming website.

   This is a short screencast overview of the second lesson:

       Commanding a Turtle.

   Your challenge, should you accept it, is to get the turtle to
   do wondrous things... draw as in art and animation, play games,
   simulate the natural world, explore whatever you want; the
   possibilities are limitless.

   First I'll introduce you to our very talented partner in this
   adventure, our turtle.

   A long time ago she existed in a truely mechanical form, a robot.
   Her playground was a large paper rug, her graphics canvas.

   These days, as in these lessons, our turtle exists as an image
   on a computer's display.


   Change the screen to TG with TurtleWorld picture loaded

       LOADPICT images\\TurtleWorld


       SETPENSIZE 10


   When you start TG, our turtle is at home, in the center of Logo's
   two-dimensional TurtleSpace. You will not see the world in the
   background, this is an image I've loaded to point out some stuff.

   Our turtle starts with a fixed vocabulary that you can instruct
   it with.  You will use this and extend it by teaching it how to
   do new things.

   Lets look at some of the simple instructions it understands. First,
   I'll put a costume on our turtle which will help me explain the
   commands you will be using in this lesson.

       SETSHAPE [1 40 150]

   Currently our turtle is headed North which in TurtleSpace is
   zero degrees.  We can change the heading with LEFT and RIGHT

       LEFT 90   RIGHT 90   RIGHT 45   LEFT 225   RIGHT 180

   We can get the turtle to draw on the graphics canvas by
   instructing it to move forward or backward.

       SETSHAPE 0   FORWARD 200   BACK 400  RIGHT 45   FORWARD 500


   In this lesson, I'll introduce a few other commands that our
   turtle understands.  Let me show you how to get help.

   The sizes of TG's different windows can be adjusted with the
   mouse. Let's grow the CommandCenter.

       show growing the CommandCenter's height

   Typing HELP in the CommandCenter will tell you more about what
   the turtle can do for you.



   Here is help for a command I just used.

   then show:

       HELP LEFT

   Help can be overwhelming initially.

   A general overview of TG is available with the HELP TG directive.


       HELP TG


   Lesson two, Commanding a Turtle, finishes with an explanation of
   using TG as a standalone application on your computer.
   Now you should go through the lesson on your own...
   Go to it... and remember - HAVE FUN!