LOGO Primitives

 

Command

Short Form

Example

Description

Chapter 3

REPEAT

REPEAT

REPEAT 4 [FD 50 RT 90]

Repeats a set number of times the commands listed in square brackets.

SLOWTURTLE

SLOWTURTLE

SLOWTURTLE

Slows the turtle down to the speed of 0.5.

SETSPEED 1

SETSPEED 1

SETSPEED 1

Restore the turtle to his / her normal speed.  (Or type a number from .1 to 1, .1 being the slowest speed, while 1 is the fastest speed.)

SETVELOCITY

SETVELOCITY number

SETVELOCITY 100

Sets the velocity of the turtle measured in pixels per second.

SPEED

SPEED

SPEED

Reports the speed of the turtle in pixels per second.

SETBG

SETBG

SETBG 2

Changes the background color.

SETPC

SETPC

SETPC 3

Changes the pen color.

Simple Color Numbers

 

 

0

Black

 

 

1

Blue

 

 

2

Green

 

 

3

Cyan

 

 

4

Red

 

 

5

Violet

 

 

6

Brown

 

 

7

Light Gray

 

 

8

Dark Gray

 

 

9

Light Blue

 

 

10

Light Green

 

 

11

Light Cyan

 

 

12

Light Red

 

 

13

Magenta

 

 

14

Yellow

 

 

15

White

Color Constants (and their RGB numbers)

 

 

WHITE

[255 255 255]

 

 

BLACK

[0 0 0]

 

 

DARKRED

[128 0 0]

 

 

RED

[255 0 0]

 

 

ORANGE

[255 159 63]

 

 

YELLOW

[255 255 0]

 

 

LIME

[0 255 0]

 

 

CYAN

[0 255 255]

 

 

DARKGREEN

[0 128 0]

 

 

GREEN

[63 191 63]

 

 

AQUA

[0 128 128]

 

 

DARKBLUE

[0 0 128]

 

 

BLUE

[0 0 255]

 

 

NAVY

[63 63 191]

 

 

MAGENTA

[128 0 128]

 

 

PURPLE

[255 0 255]

 

 

GRAY

[128 128  128]

 

 

BROWNISH

[128 128 0]

 

 

BROWN

[159 95 63]

 

 

PINK

[255 127 191]

 

 

GOLD

[255 223 63]

 

 

SILVER

[192 192  192]

In order to use the color names, you will need a double quote before the color name.  Type the color name in ALL CAPITAL letters.  For example, SETPC “SILVER

If you wish to use the custom color numbers, enclose them in square brackets.  For example, SETPC [255 0 0] sets the pen color to RED.

CLEARTEXT

CT

CT

This command clears the text from the Listener window.

SETWIDTH

SETW

SETW 10

This changes the width of the turtle’s “pen”.  You can choose a number between 1 and 99. The default width is 1.

SETTURTLESIZE

SETTSIZE or

SETTS

SETTSIZE 5 or
SETTS 5

This changes the size of the turtle.  You can choose from 0 to 50.  Size 1 is the normal size.

WIDTH

WIDTH

WIDTH

Reports the width of the turtle’s pen.

FILL

FILL

FILL

1)      Draw a completely closed shape

2)      PU

3)      Move the turtle inside that closed shape

4)      PD

5)      Choose your color (optional)

6)      FILL

WRAP

WRAP

WRAP

This mode allows the turtle to “WRAP” around the screen.  If the turtle moves off the edge of the window, it reappears at the opposite side.

FENCE

FENCE

FENCE

This command prevents the turtle from moving beyond the visible boundary of the Graphics window.

CLEAN

CLEAN

CLEAN

This clears the graphics window without moving the turtle back to the home position.