LOGO Commands, Part 1

Note: In addition to commands illustrated here, other commands are listed and explained under the "Help" menu in the MicroWorlds program. On the "Help" menu, drag down to "Vocabulary." This will provide a list of all LOGO commands. Click on any one of the commands, and you will get an explanation of the command.

Explanations will be in black.

Commands will be in red.

Especially important notes will be in Carolina Blue.

Commands are typed either in the Command Center, or in programming a button or a turtle, or in writing a program.

I. Turtle Movement

Turtle movements constitute a model of two-dimensional geometry. Seymour Papert deleloped LOGO using a radio controlled "turtle" moving on a floor. As you work with LOGO, take note of the many correlations between LOGO and the two-dimensional world.

There are four basic movements of turtles. Turtles can move forward or backward, and they can turn to the right or the left. Examples:

fd 50 (Moves the turtle 50 turtle steps in the direction in which the turtle is headed)

bk 70 (Moves the turtle 70 turtle steps in the opposite direction)

rt 30 (Turns the turtle to the right 30 degrees)

lt 75 (Turns the turtle to the left 75 degrees)

II. Pen Commands

Papert afixed a pen to the turtle so that when it moved it would draw a line if the pen touched the floor. When MicroWorlds is started, the default position of the pen is up, so if you move a turtle with the pen up it will not draw a line. The pen always remains in its current state until a different pen command is given. Following are examples of pen commands:

pd (Puts the pen down so that it touches the "floor")

pu (Picks the pen up off of the "floor")

pe (Turns the pen upside down so that an "eraser" will erase the line if the pen is down)

III. Screen Commands

cg (Clears all graphics from the screen and places the turtle in the center of the screen, headed straight toward the top of the screen)

clean (Clears all graphics from the screen, but leaves the turtle as it is)

ct (Clears text from a text box)

cc (Clears the Command Center)

IV. Print Commands

pr 37 (Prints 37 in a text box. Note that quotes are not used with numbers.)

pr "Hello (Prints Hello in a text box. Note that quotes are used before, but not after, the word that is to be printed. This command is used for a single letter or for a word, but not for more than one word.)

pr [Hello there.] ( Prints Hello there. in a text box. Note that if more than one word is to be printed, square brackets must be used.)

pr char 32 (Prints a space. char 32 is the computer's name for the space bar.)

insert (If this is used instead of pr in any of the four cases above, the same printing occurs, but the cursor does not go to the next line. This is useful if for any reason you write a program in which you want to have more than one print statement put on the same line. For example, if in an interactive program you wanted to correct a student's response, this is the series of commands you would use: insert [Sorry, but the answer is] insert char 32 pr :x This will print everything on the same line.

:x is LOGO's way of denoting a variable. In cases in which problems are chosen at random, you won't know the answer, but the computer will, so this is a way to provide the student with feedback. Variables are discussed below.

show (If this is used instead of pr in any of the four cases above, the same printing occurs, but the printing occurs in the Command Center.

V. Colors

You can choose the main colors for the background and the turtles by the name of the colors. Since there are many more numbers than we have names for them, you can also choose color by an identifying number. You can find the color of a particular number by going to the "Help" menu, and dragging down to the question mark. Next, place the question mark on the color you want on the color bar on the Drawing Tools bar on the Command Center. You can use this same procedure for finding the names of turtles, text boxes, buttons, and sliders.

setc "red (This makes the color of the turtle State red.)

setc 94 (This makes the color of the turtle Carolina blue.)

setbg "blue (This makes the color of the background Dook blue.)

setbg 35 (This sets the background some other color.)