LIST OF COMMANDS

TURTLE MOTION

FD BK
LT RT
SETPOS SETXY
SETX SETY
SETH

TURTLE MOTION QUERIES

POS XCOR
YCOR HEADING
TOWARDS SCRUNCH

TURTLE AND WINDOW CONTROL

ST HT CLEAN
CS WRAP WINDOW
FENCE FILL LABEL
TS FS SS
SETSCRUNCH REFRESH NOREFRESH

TURTLE AND WINDOW QUERIES

SHOWN?

PEN AND BACKGROUND CONTROL

PD PU PPT
PE PX SETPC
SETPALETTE SETPEN SETBG

PEN QUERIES

PENDOWN? PALETTE BG

FD dist

Moves the turtle forward, in the direction that it's facing, by the specified distance (measured in turtle steps).

BK dist

Moves the turtle backward, i.e., exactly opposite to the direction that it's facing, by the specified distance. (The heading of the turtle does not change.)

LT degrees

Turns the turtle counterclockwise by the specified angle, measured in degrees (1/360 of a circle).

RT degrees

Turns the turtle clockwise by the specified angle, measured in degrees (1/360 of a circle).

SETPOS pos

Moves the turtle to an absolute screen position. The argument is a list of two numbers, the X and Y coordinates.

SETXY xcor ycor

Moves the turtle to an absolute screen position. The two arguments are numbers, the X and Y coordinates.

SETX xcor

Moves the turtle horizontally from its old position to a new absolute horizontal coordinate. The argument is the new X coordinate. *Go to home page

SETY ycor

Moves the turtle vertically from its old position to a new absolute vertical coordinate. The argument is the new Y coordinate. HOME moves the turtle to the center of the screen. Equivalent to SETPOS [0 0].

SETH degrees

Turns the turtle to a new absolute heading. The argument is a number, the heading in degrees clockwise from the positive Y axis. ARC angle radius draws an arc of a circle, with the turtle at the center, with the specified radius, starting at the turtle's heading and extending clockwise through the specified angle. The turtle does not move.

TURTLE MOTION QUERIES

POS

Outputs the turtle's current position, as a list of two numbers, the X and Y coordinates.

XCOR

Outputs a number, the turtle's X coordinate.

YCOR *Go to home page

Outputs a number, the turtle's Y coordinate.

HEADING

Outputs a number, the turtle's heading in degrees.

TOWARDS pos

Outputs a number, the heading at which the turtle should be facing so that it would point from its current position tothe position given as the argument.

SCRUNCH

Outputs a list containing two numbers, the X and Y scrunch factors, as used by SETSCRUNCH. (But note that SETSCRUNCH takes two numbers as inputs, not one list of numbers.)

TURTLE AND WINDOW CONTROL

SHOWTURTLE (ST)

Makes the turtle visible.

HIDETURTLE (HT)

Makes the turtle invisible. It's a good idea to do this while you're in the middle of a complicated drawing, because hiding the turtle speeds up the drawing substantially.

CLEAN

Erases all lines that the turtle has drawn on the graphics window. The turtle's state (position, heading, pen mode, etc.) is not changed.

CLEARSCREEN (CS)

Erases the graphics window and sends the turtle to its initial position and heading. Like HOME and CLEAN together.

WRAP

Tells the turtle to enter wrap mode: From now on, if the turtle is asked to move past the boundary of the graphics window, it will "wrap around" and reappear at the opposite edge of the window. The top edge wraps to the bottom edge, while the left edge wraps to the right edge. (So the window is topologically equivalent to a torus.) This is the turtle's initial mode. Compare WINDOW and FENCE.

WINDOW

Tells the turtle to enter window mode: From now on, if the turtle is asked to move past the boundary of the graphics window, it will move offscreen. The visible graphics window is considered as just part of an infinite graphics plane; the turtle can be anywhere on the plane. (If you lose the turtle, HOME will bring it back to the center of the window.) Compare WRAP and FENCE.

FENCE

Tells the turtle to enter fence mode: From now on, if the turtle is asked to move past the boundary of the graphics window, it will move as far as it can and then stop at the edge with an "out of bounds" error message. Compare WRAP and WINDOW.

FILL

Fills in a region of the graphics window containing the turtle and bounded by lines that have been drawn earlier. This is not portable; it doesn't work for all machines, and may not work exactly the same way on different machines.

LABEL

Text takes a word or list as input, and prints the input on the graphics window, starting at the turtle's position.

TEXTSCREEN (TS)

Rearranges the size and position of windows to maximize the space available in the text window (the window used for interaction with Logo). The details differ among machines. Compare SPLITSCREEN and FULLSCREEN.

FULLSCREEN (FS)

Rearranges the size and position of windows to maximize the space available in the graphics window. The details differ among machines. Compare SPLITSCREEN and TEXTSCREEN. In the DOS version, switching from fullscreen to splitscreen loses the part of the picture that's hidden by the text window. Also, since there must be a text window to allow printing (including the printing of the Logo prompt), Logo automatically switches from fullscreen to splitscreen whenever anything is printed. [This design decision follows from the scarcity of memory, so that the extra memory to remember an invisible part of a drawing seems too expensive.]

SPLITSCREEN (SS)

Rearranges the size and position of windows to allow some room for text interaction while also keeping most of the graphics window visible. The details differ among machines. Compare TEXTSCREEN and FULLSCREEN.

SETSCRUNCH

Adjusts the aspect ratio and scaling of the graphics display. After this command is used, all further turtle motion will be adjusted by multiplying the horizontal and vertical extent of the motion by the two numbers given as inputs. For example, after the instruction "SETSCRUNCH 2 1" motion at a heading of 45 degrees will move twice as far horizontally as vertically. If your squares don't come out square, try this. (Alternatively, you can deliberately misadjust the aspect ratio to draw an ellipse.) For Unix machines and Macintoshes, both scale factors are initially 1. For DOS machines, the scale factors are initially set according to what the hardware claims the aspect ratio is, but the hardware sometimes lies. The values set by SETSCRUNCH are remembered in a file (called SCRUNCH.DAT) and are automatically put into effect when a Logo session begins.

REFRESH

Tells Logo to remember the turtle's motions so that they can be reconstructed in case the graphics window is overlayed. The effectiveness of this command may depend on the machine used.

NOREFRESH

Tells Logo not to remember the turtle's motions. This will make drawing faster, but prevents recovery if the window is overlayed.

TURTLE AND WINDOW QUERIES

---------------------------

SHOWNP (SHOWN?)

Outputs TRUE if the turtle is shown (visible), FALSE if the turtle is hidden. See SHOWTURTLE and HIDETURTLE.

PEN AND BACKGROUND CONTROL

The turtle carries a pen that can draw pictures. At any time the pen can be UP (in which case moving the turtle does not change what's on the graphics screen) or DOWN (in which case the turtle leaves a trace). If the pen is down, it can operate in one of three modes: PAINT (so that itdraws lines when the turtle moves), ERASE (so that it erases any lines that might have been drawn on or through that path earlier), or REVERSE (so that it inverts the status of each point along the turtle's path).

PENDOWN ( PD)

Sets the pen's position to DOWN, without changing its mode.

PENUP (PU)

Sets the pen's position to UP, without changing its mode.

PENPAINT (PPT)

Sets the pen's position to DOWN and mode to PAINT.

PENERASE (PE)

Sets the pen's position to DOWN and mode to ERASE.

PENREVERSE (PX)

Sets the pen's position to DOWN and mode to REVERSE. (This may interact in hardware-dependent ways with use of color.)

SETPENCOLOR colornumber SETPC

Colornumber sets the pen color to the given number, which must be a nonnegative integer. Color 0 is always black; color 7 is always white. Other colors may or may not be consistent between machines.

SETPALETTE

Sets the actual color corresponding to a given number, if allowed by the hardware and operating system. Colornumber must be an integer greater than or equal to 8. (Logo tries to keep the first 8 colors constant.) The second argument is a list of three nonnegative integers less than 64K (65536) specifying the amount of red, green, and blue in the desired color. The actual color resolution on any screen is probably less than 64K, but Logo scales as needed. SETPENSIZE size SETPENPATTERN pattern set hardware-dependent pen characteristics. These commands are not guaranteed compatible between implementations on different machines.

SETPEN list (library procedure)

Sets the pen's position, mode, and hardware-dependent characteristics according to the information in the input list, which should be taken from an earlier invocation of PEN.

SETBACKGROUND color

SETBG color set the screen background color.

PEN QUERIES

PENDOWNP PENDOWN?

Outputs TRUE if the pen is down, FALSE if it's up.

PALETTE colornumber

Outputs a list of representing the associated with t PENSIZE PENPATTERN output hardware-s PEN outputs a list co hardware-specific

BACKGROUND BG

Outputs the graph

-------------------