Terrapin Resources

Terrapin Logo 4 has been discontinued! Our new Terrapin Logo version is much more powerful and modern; we strongly recommend that you update to our latest release of the Logo programming language.

Table of Contents

A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | Q | R | S | T | U | V | W | Variables | Math Operators

Logo Commands

This section contains an alphabetic listing of all Logo commands.

. Top ⬆
.WHO Reports a list of objects listening to commands.
.WINDOWS Call a Windows system function (not available on the Mac).

A

  Top ⬆
ABOUT User-supplied procedure to display an About box.
ABS Reports the absolute value of a number.
ACTIVEWINDOW (ACTIVEW) Reports the name of the active graphics window.
AGET Reports the value of an array element.
ALERT Displays an alert box.
ALIAS Defines alias names.
ALL (CONTENTS) Outputs a complete structured contents list.
ALLTURTLES A list of all turtles.
AND Logical AND.
APPENDMENU Appends a new menu.
APPENDMENUCOMMAND Appends a new menu item.
APPENDMENUITEM Appends a new menu item.
APPLY Applies a parameter list to a procedure.
ARCCOS (ACOS) Reports the arccosine.
ARCCOT (ACOT) Reports the arccotangent.
ARCCSC (ACSC) Reports the arccosecant.
ARCSEC (ASEC) Reports the arcsecant.
ARCSIN (ASIN) Reports the arcsine.
ARCTAN (ATAN) Reports the arctangent.
ARCTAN2 (ATAN2) Reports the polar angle heading of the motion vector (position change) deltaX deltaY.
ARRAY Creates an array.
ARRAY? (ARRAYP) Reports TRUE if the object is an array.
ARRAYDIMS Reports the structure of an array.
ASCII Converts a character into its ASCII value.
ASET Sets the value of an array element.
ASK Makes objects execute a list of commands.

B

  Top ⬆
BACK (BK) Moves a turtle backwards.
BACKGROUND (BG) Reports the background color.
BACKTRACE (BT) Prints a backtrace.
BGPATTERN Reports the background pattern.
BLUEBOT.CLEAR Clears all commands stored in Blue-Bot’s memory.
BLUEBOT.CLOSE Closes the Blue-Bot connection.
BLUEBOT.GO Executes commands stored in Blue-Bot’s memory.
BLUEBOT.OPEN Opens the connection to Blue-Bot.
BLUEBOT.RUN Executes Blue-Bot commands.
BLUEBOT.STATUS Reports status information about Blue-Bot.
BLUEBOT.WRITE Downloads a procedure to Blue-Bot.
BLUEBOT? (BLUEBOTP) Tests if the Blue-Bot drivers are installed.
BURIED Outputs a structured contents list of all buried elements.
BURIED? (BURIEDP) Outputs TRUE if the element described by its input is buried.
BURIEDNAMES Outputs a list of all buried names.
BURIEDPROCS Outputs a list of all buried procedures.
BURIEDPROPS Outputs a list of all buried property lists.
BURY Makes names and procedures invisible.
BURYALL Makes all names and procedures invisible.
BURYNAME Makes one or more names invisible.
BURYNAMES Makes all names invisible.
BURYPROC Makes one or more procedures invisible.
BURYPROCS Makes all procedures invisible.
BURYPROP Makes one or more property lists invisible.
BURYPROPS Makes all property lists invisible.
BUTFIRST (BF) Reports all but the first element of its input.
BUTLAST (BL) Reports all but the last element of its input.
BUTMEMBER (BM) Removes an element from its input.
BUTTON? (BUTTONP) Reports the state of a mouse button.
BYE (QUIT) Ends Logo.
BYTEARRAY Creates an array of byte values.
BYTEARRAY? (BYTEARRAYP) Reports TRUE if the object is a bytearray.

C

  Top ⬆
CATCH Catches runtime errors and THROWn data.
CHAR Converts a number into a Unicode character.
CHECKTYPE Checks an value for a type.
CLEAN Erases the graphics panel.
CLEARINPUT Clears all input from a stream.
CLEARSCREEN (CS) Erases the graphics panel and homes the turtle.
CLEARTEXT (CT) Clears the Listener panel.
CLOSE Closes a stream.
CLOSEWINDOW Closes a window.
COLOR Reports the color for a name or value if possible.
COLORINDEX (BASECOLOR) Coerces a color value to a basic Logo color number.
COLORNAME Reports the name of a color if possible.
COLORS Reports a list of available color names.
COMMAND Invoke a menu command by its ID number.
CONTINUE (CO) Ends a pause.
COPYDEF Copies a procedure definition.
COS Reports the cosine.
COT Reports the cotangent.
COUNT Counts the number of items in its input.
CPROP Calls a property as a procedure.
CREATE Creates a file.
CREATE.DIR Creates a folder.
CSC Reports the cosecant.
CTURTLES Arranges turtles in a circle.
CURDIR Reports the current working directory.

D

| | Top ⬆ | | - | - | | DATE | Reports the date. | | DECLARE (DCL) | Creates an object. | | DEFINE | Defines a procedure. | | DEFINED? (DEFINEDP) | Checks whether a procedure is defined. | | DELETE | Deletes one or more files from disk. | | DELETEMENU | Deletes a menu. | | DELETEMENUITEM | Deletes a menu item. | | DIRECTORY (DIR) | Lists the contents of current working directory. | | DISTANCE | Reports the distance between the turtle and a location. | | DOT | Draws a dot. | | DOT? (DOTP) | Tests whether a pixel with a color other than the background color is present. | | DOTCOLOR | Reports the color of a pixel. | | DRAW | Clears the current graphics window and resets all attached turtles. |

E

| | Top ⬆ | | - | - | | EACH | Applies a runlist to every object in the TELL list. | | EDALL | Edits the entire Logo workspace. | | EDIT (ED) | Edits parts or all of the Logo workspace. | | EDL | Edits a list. | | EDN | Edits one or more Logo names. | | EDNS | Edits all Logo names. | | EDP | Edits one or more Logo procedures. | | EDPL | Edits one or more Logo property lists. | | EDPLS | Edits all Logo properties. | | EDPS | Edits all user-defined, unburied procedures. | | ELSE | Starts the ELSE branch of an IF command. | | EMPTY? (EMPTYP) | Checks whether a name is empty. | | END | Ends a procedure definition. | | EOF? (EOFP) | Outputs TRUE if the current stream is at EOF. | | ERALL | Edits the entire Logo workspace. | | ERASE (ER) | Erases Logo elements. | | ERN | Erase one or more Logo names. | | ERNS | Erases all Logo names. | | ERPL | Erases one or more Logo property lists. | | ERPLS | Erases all Logo properties. | | ERPS | Erases all procedures. | | EVAL | Runs a list and collects all outputs. | | EVERY | Outputs a list of objects. | | EXECTIME | Outputs the number of microseconds spent inside a procedure. | | EXPN (EXP) | Calculates the natural base e raised to a power. | | EXTENT | Reports the extent of the current Graphics window. |

F

  Top ⬆
FENCE Fences all turtles inside the drawing borders.
FILE.INFO Reports information about a file.
FILE? (FILEP) Reports TRUE if a file or directory exists.
FILL Fills an area.
FILLARRAY Sets the values of an array.
FINDMENUID Finds the ID of a menu item.
FIRST Reports the first element of its input.
FLATTEN Reports a flat version of its list input.
FONT Reports the current font of the first active turtle.
FONTS Reports a list of all loaded and available fonts.
FOR Runs a list for a defined number of times.
FOREACH Runs a list for each element of its first input.
FOREVER Runs a list forever.
FORWARD (FD) Moves a turtle forward.
FPUT Prepends an element to its input.
FROMMEMBER (FM) Removes the first part of its input until a pattern is found.
FULLSCREEN (FS) Switches to the Full Screen perspective.

G

  Top ⬆
GETBYTE Reads one byte from the input stream.
GETX (XCOR) Reports the X coordinate of a turtle.
GETXY (POS) Reports the coordinates of a turtle.
GETY (YCOR) Reports the Y coordinate of a turtle.
GLIST Reports the property lists that contain a property with a given name.
GO Jumps to a label inside a procedure.
GPROP Retrieves a property.
GRID Sets the size of the graphics grid.
GRIDOFF Hides the grid of the Graphics window.
GRIDON Displays the grid of the Graphics window.

H

  Top ⬆
HALT Stops one or all background procedures.
HEADING Reports the heading of a turtle.
HELP Displays help for a command.
HIDETURTLE (HT) Hides a turtle.
HOME Moves the turtle back to [0 0].

I

  Top ⬆
IF Runs instructions based on a condition.
IFFALSE (IFF) Runs a list if TEST was false.
IFTRUE (IFT) Runs a list if TEST was true.
IGNORE Ignores the output of a procedure.
INT Reports the integer part of a number.
IS.A Checks an object for being of a specific type.
ISEQ Outputs a list of sequential integers.
ITEM Returns a specific element of its input.

K

  Top ⬆
KEY Reports the code of the last key that the user typed.

L

  Top ⬆
LABEL Marks a target for the GO command.
LAST Reports the last element of its input.
LAUNCH Launches a runlist or procedure for execution in the background.
LEFT (LT) Turns a turtle left.
LIST Concatenates its inputs to a list.
LIST? (LISTP) Checks for its input being a list.
LISTARRAY Reports the values of an array as a list.
LOAD Loads a file into Logo.
LOADPIC Loads a picture as background picture.
LOADSHAPE Loads a turtle shape from disk and sets the shape of all active turtles.
LOADSNAP Loads a bitmap.
LOCAL Declares local variables inside a procedure.
LOCKSHAPE Prevents a bitmap from turning.
LOG (LN) Outputs the natural logarithm of its input.
LOG10 Outputs the logarithm of its input.
LOGAND Combines its inputs with a boolean AND operation.
LOGNOT Reports the bitwise logical complement of its input.
LOGOR Combines its inputs with a boolean OR operation.
LOGXOR Combines its inputs with a boolean XOR operation.
LOWERCASE Converts its argument to lower case.
LPUT Appends an element to its input.
LSH (ASHIFT) Shifts its input with sign extension.
LTURTLES Arranges turtles in a row.

M

  Top ⬆
MAKE Assigns a value to a name.
MEMBER? (MEMBERP) Checks if an object is part of another object.
MILLISECONDS Outputs the number of milliseconds spent since January 1, 1970.
MIXEDCASE Converts its argument to mixed case.
MODULO Outputs the remainder of two numbers.
MOUSE Reports the position of the mouse cursor.
MOUSESHAPE Reports the shape of the mouse cursor.

N

  Top ⬆
NAME Assigns a value to a name.
NAME? (NAMEP) Checks whether its input is assigned a value.
NAMELIST Outputs a structured contents list with names.
NAMES Outputs a structured contents list with all names.
NEW Creates a new Logo object.
NOT Negates its input.
NUMBER? (NUMBERP) Checks its input for being a number.

O

  Top ⬆
ONCOMMAND Defines the commands that execute when a menu item is selected.
OPEN Opens a file and returns the channel number.
OPEN.PORT Opens a serial port for I/O.
OR Performs a logical OR on its input.
ORIGIN Reports the origin of a turtle’s coordinate system.
OUTPUT (OP) Exits a procedure and outputs a value.

P

  Top ⬆
PANGLE Reports the turtle’s angle as a polar angle.
PARSE Parses a string and outputs a list.
PATTERN Reports the turtle’s pattern.
PAUSE Pauses a procedure.
PDIST Reports the distance from the turtle to its home.
PEEKBYTE Returns the next character from the input stream without reading it.
PEN Reports the pen mode.
PENCOLOR (PC) Reports the pen color.
PENDOWN (PD) Puts the pen down.
PENDOWN? (PENDOWNP) Checks whether the pen is down.
PENERASE (PE) The pen draws with the background color.
PENREVERSE (PX) The pen inverts all colors.
PENUP (PU) The pen moves up.
PHEADING Reports the turtle’s polar heading.
PI Reports the number Pi.
PICK Randomly picks an element.
PLAY Plays sound files and lists of notes.
PLIST Reports the property list of a name.
PLISTS (PROPERTIES) Outputs a structured contents list with all properties.
PLLIST Outputs a structured contents list with properties.
POALL Prints the entire Logo workspace.
PON Prints a Logo name.
PONS Prints all Logo names.
POPL Prints one or more Logo property lists.
POPLS Prints all Logo properties.
POPRS Prints the title of all Logo primitives.
POPS Prints all Logo procedures.
POT Prints the title line of one or more user-defined procedures.
POTS Prints the title line of all user-defined procedures.
PPOS Reports the turtle’s polar position.
PPROP Stores a property.
PPROPS Stores a list of properties.
PRIMITIVE? (PRIMITIVEP) Checks its input for being a built-in procedure or macro.
PRIMITIVES Outputs a structured contents list with all primitives.
PRINT (PR) Prints text with a line feed.
PRINTLINE Prints a list of numbers as Unicode characters.
PRINTOUT (PO) Prints procedures, names, or properties.
PRINTQUOTE (PQ) Prints its input and a newline.
PROBOT.LIGHTS Turns the Pro-Bot’s headlights on or off.
PROBOT.READ Uploads all Pro-Bot procedures into Logo’s workspace.
PROBOT.SOUND Plays Pro-Bot sounds.
PROBOT.WRITE Downloads all Pro-Bot procedures to the Pro-Bot.
PROBOT? (PROBOTP) Tests if a Pro-Bot is connected.
PROCEDURE? (PROCEDUREP) Checks its input for being a user-defined procedure.
PROCEDURES Outputs a list with all user procedures.
PROCLIST Outputs a structured contents list with procedures.
PSETHEADING (PSETH) Sets the polar heading of a turtle.
PUTBYTE Writes a data byte or a Unicode character to the output stream.
PUTBYTES Writes data bytes or characters to the output stream and reads a reply.

Q

  Top ⬆
QUOTE Quotes its input.

R

  Top ⬆
RANDOM Outputs a random number.
READ Reads one Logo word.
READCHAR (RC) Reads a character from the input stream.
READLINE Reads a line and outputs it as a list of numbers.
READLIST (RL) Reads a line and outputs it as a list.
READPROMPT (RP) Opens a dialog box and reads a line.
READQUOTE (RQ) Reads a line.
READWORD Reads the first word of a line.
RECYCLE Starts the garbage collector.
REMPROP Removes a property.
RENAME Renames a disk file.
REPCOUNT Reports the value of the REPEAT counter.
REPEAT Runs a runlist repeatedly.
REPTOTAL Reports the total number of REPEATs.
RERANDOM Seed the random number generator.
RESTART Erases everything and restarts Logo.
RIGHT (RT) Turns a turtle right.
ROUND Rounds a number.
RSEQ Outputs a list of equally spaced rational numbers.
RUN Runs a word or list.

S

  Top ⬆
SAVE Saves the workspace to disk.
SAVEPIC Saves the contents of the Graphics window.
SAVESHAPE Saves a turtle shape.
SAVESNAP Saves a turtle shape.
SEC Reports the secant.
SELECT.FILE Displays a dialog to select a disk file.
SELECT.FOLDER Displays a dialog to select a disk folder.
SENTENCE (SE) Concatenates its inputs to a list, flattening lists.
SETACTIVEWINDOW (SETACTIVEW) Sets the name of the active window.
SETBG Sets the background color.
SETBGPATTERN Sets the background pattern.
SETCURDIR Changes the current working directory.
SETEXTENT Set the extent of the current Graphics window.
SETFONT Sets the turtle drawing font.
SETHEADING (SETH) Sets the heading of a turtle.
SETMOUSESHAPE Sets the shape of the mouse cursor.
SETORIGIN Sets the coordinate system origin of the active turtles.
SETP Sets the turtle’s polar position.
SETPATTERN Sets the turtle pattern.
SETPC Sets the pen color.
SETPEN Sets the pen characteristics.
SETSHAPE Sets the shape of all active turtles.
SETSPEED Sets the speed at which turtle commands are executed.
SETSTEPSIZE Sets the step size of all active turtles and bitmaps.
SETTURTLENAME (SETTNAME) Sets the name of a turtle.
SETTURTLES (SETT) Creates a range of turtles.
SETTURTLESIZE (SETTSIZE) Sets the size of a turtle.
SETTWINDOW Attaches a turtle to a Graphics window.
SETVELOCITY Sets the independent speed of a turtle.
SETWIDTH (SETW) Sets the pen width.
SETWINSIZE Sets the size of a window.
SETWPOS Sets the position of a window.
SETWSIZE Sets the size of a floating window.
SETX Sets the X coordinate of a turtle.
SETXY (SETPOS) Sets the coordinates of a turtle.
SETY Sets the Y coordinate of a turtle.
SHAPE Outputs the name of the first active turtle’s shape.
SHOW Prints text with a line feed.
SHOWN? (SHOWNP) Reports whether a turtle is visible.
SHOWTURTLE (ST) Makes a turtle visible.
SIN Reports the sine.
SLOWTURTLE Slows down the turtle to half speed.
SNAP Moves parts of the graphics window into a bitmap.
SNAPSIZE Outputs the size of a bitmap.
SPEED Reports the speed at which turtle commands are executed.
SPLITSCREEN (SS) Switches to the Split Screen perspective.
SQRT Reports the square root.
STAMP Draw a bitmap or turtle.
STAMPOVAL Draws an oval.
STAMPRECT Draws a rectangle.
STEPSIZE Outputs the step size of the first active turtle or bitmap.
STOP Exits a procedure.
SUBDIR Lists the contents of current working directory.
SUBST Substitutes text in a word or a list.

T

  Top ⬆
TAN Reports the tangent.
TELL Defines a list of objects listening to commands.
TELLALL Tells a range of turtle numbers.
TELLEVEN Tells all turtles with even numbers.
TELLODD Tells all turtles with odd numbers.
TEST Test a condition; used with IFTRUE and IFFALSE.
TEXT Outputs a procedure definition.
TEXTARRAY Sets the structure of an array.
TEXTSCREEN (TS) Switches to the Text Screen perspective.
THEN Starts the THEN branch of an IF command.
THING Reports the value of a name.
THROW Throws a Logo word or a runtime error.
TIME Outputs the time.
TO Defines a procedure.
TOPLEVEL Returns to toplevel.
TOWARDS Reports the angle of a position compared to the turtle position.
TURTLENAME (TNAME) Gets the name of the first active turtle.
TURTLENAMES (TNAMES) Outputs a list of all turtle names.
TURTLES Reports the number of turtles.
TURTLESIZE (TSIZE) Reports the size of a turtle.
TURTLETEXT (TT) Prints its input on the Graphics window.
TURTLETEXTBASE (TTBASE) Outputs the baseline offset of the first listening turtle’s font.
TURTLETEXTSIZE (TTSIZE) Outputs the dimensions of a text drawn with the first listening turtle.
TWINDOW Outputs the name of the window of the first active turtle.
TYPE Prints text.
TYPEOF Reports the type of a name.

U

  Top ⬆
UNBURY Makes names and procedures visible.
UNBURYALL Makes all names and procedures visible.
UNBURYNAME Makes one or more names visible.
UNBURYNAMES Makes all names visible.
UNBURYPROC Makes one or more procedures visible.
UNBURYPROCS Makes all procedures visible.
UNBURYPROP Makes one or more property lists visible.
UNBURYPROPS Makes all property lists visible.
UNGETBYTE Pushes back one character to the input stream.
UNLOCKSHAPE Lets a bitmap rotate according to the turtle’s heading.
UPPERCASE Converts its argument to upper case.

V

  Top ⬆
VELOCITY Reports the independent movement speed of a turtle.
VERINFO Outputs Logo version information as a list.
VERSION (VER) Outputs the Logo version.

W

  Top ⬆
WAIT Waits for a number of milliseconds.
WHILE Runs a list until a condition is false.
WHO Reports a list of objects listening to commands.
WIDTH Reports the pen width.
WINDOW Removes the boundary for turtle movements.
WINSIZE Reports the size of a window.
WORD Concatenates its inputs to a word.
WORD? (WORDP) Checks its input for being a word.
WORKSPACE.VIEW Switches to the Work perspective.
WPOS Outputs the position of a window.
WRAP Lets the turtles wrap inside the window.
WSIZE Reports the size of a window.

Variables

  Top ⬆
“LOGO.ENV Contains a property list of global program and system settings.
“PREFS System-wide properties.
:BASE Sets the numeric base used when printing numbers.
:CASE Makes Logo convert its input to upper case or not.
:CURRENT.GRAPHICS Contains the current graphics window name.
:CURRENT.WINDOW Contains the current window name.
:DATADIR Reports the user’s data directory.
:DESKTOPDIR Reports the desktop directory.
:ERROR Contains the type of the last runtime error.
:ERRORTEXT Reports the text of the last caught runtime error or THROWn word.
:INITIAL.LAYOUT Reports or sets the initial layout of Logo panels.
:LAYOUT Reports or sets the layout of Logo panels.
:LOGODIR Reports Logo’s startup directory.
:PICTURE.FORMAT Controls the format of saved pictures.
:PRECISION Sets the precision in which numbers are printed.
:STANDARD.INPUT The number of the input stream.
:STANDARD.OUTPUT The number of the output stream.
:TAB Sets the tab stop position.
:TRACE Controls the output of debugging information.
:USERNAME Reports the login user ID.

Math Operators

  Top ⬆
* (PRODUCT) Calculates the product of its inputs.
+ (SUM) Reports the sum of its inputs.
- (DIFFERENCE) Outputs the difference of two or more numbers.
/ (QUOTIENT) Reports the quotient of its inputs.
< (.LT) Tests if its first input is less than its second input.
<= (.LE) Tests if its first input is less than or equal to its second input.
<> (!=) Tests its inputs for inequality.
= (.EQ) Tests its inputs for equality.
> (GREATER?) Tests if its first input is greater than its second input.
>= (.GE) Tests if its first input is greater than or equal to its second input.
REMAINDER (%) Outputs the remainder of two numbers.
^ (POWER) Raises a number to the power of another number.