turtleSpaces Logo Command / Primitive Reference

Jump to index


flags

-login “user

-open “turtlespace

-load “logofile

-enable-api


example [shortcut]

categories: mathematics – words and lists – tables – grammar – movement and vectors – shapes and graphics – text – conditionals and flow – booleans – containers – environment – input and output – control – sound and music – turtles

input (multiple parameters indicated by the pipe | symbol)

output

This is the description of an example primitive entry.

example usage


@

control

primitivename

none

@ allows you to run the built-in primitive of the given primitivename, when there is a user-defined procedure with that name typically overriding it. See runprimitive

@forward 20


:container

containers

none

none

A colon : indicates a container, with the name of the word following the colon. turtleSpaces ‘resolves’ a :container ‘tag’ into the value of that container when an instruction is executed, such that if the value of :container is 5, then forward :container becomes ‘resolved’ to forward 5, before the instruction is executed.

show :container


word

words and lists

none

none

A word is an atomic word of characters. Words can be declared in two ways: either by prefacing them with a double quote ” as in “word, which does not allow spaces in the word, as the space would break the word, or with pipes as in |long word|, which can contain spaces within them. Keep in mind that a long word is treated as an atomic (single) word, and as such if you attempt to use list primitives on a long word they will not work the way you might expect, as they will only see one item.

print "word
print |long word|


number

mathematics

none

none

A number is any element where all the items are a number (which can include a decimal point .) such as 123 or 413.21. Numbers can be stored in containers, for example: put 5 in :container

show 214.32


boolean

:=

containers

expression | expression

none

Assigns the value of the second expression to the container name resolved by the first expression. See make for more details

So, for example, "frog := 5 puts the value 5 in the container named frog. However, :frog := 5 puts the value of 5 in the container named whatever is inside the container named frog.

"frog := "duck
:frog = 5
show :duck
5


+

mathematics

number | number

number

Adds two numbers or numerical results of other primitives. Can be placed before or between the two items to be added. Similar to sum

print 3 + 4 print + 3 4
make "container xpos + ypos


mathematics

number | number

number

Subtracts two numbers or numerical results of other primitives. Similar to difference

print 5 - 4
1


*

mathematics

number | number

number

Multiplies two numbers or numerical results of other primitives. Similar to product

print 6 * 3
18


/

mathematics

number | number

number

Divides two numbers or numerical results of other primitives. Similar to quotient

print 12 / 4
3


^

mathematics

number | number

number

Returns the first number to the power of the second number. Similar to power

show 5 ^ 3
125


%

mathematics

number | number

number

Returns the remainder from dividing the first number by the second number. Similar to remainder

show 10 % 4
2


~

boolean

number | number

boolean

Approximate. Similar to round (number) = round (number) – returns true if the rounded inputs are equal. Similar to approximate

show 5.4 ~ 4.7
TRUE


= ==

conditionals and flow

expression = expression

boolean

Returns 1 (true) if expression1 equals (has the same result) as expression2. May be placed before or between the two expressions to be compared. If the expression is complex (is a chain of primitives, procedures or mathematical operations), it needs to be surrounded by brackets (). See equalp

if expression1 = expression2 [print [These are the same!]]
if (xpos + 4) = (ypos - 13) [...]
print = 1 2
0


>

conditionals and flow

expression > expression

boolean

Returns 1 (true) if expression1 is greater than expression2. Symbols may be placed before or between the two expressions to be compared. If the expression is complex (is a chain of primitives, procedures or mathematical operations), it needs to be surrounded by brackets ().

if :frogs > 0 [print "ribbit]


<

conditionals and flow

expression < expression

boolean

Returns 1 (true) if expression1 is less than expression2. Symbols may be placed before or between the two expressions to be compared. If the expression is complex (is a chain of primitives, procedures or mathematical operations), it needs to be surrounded by brackets ().

if :ships < 1 [gameover]


>=

conditionals and flow

expression >= expression

boolean

Returns 1 (true) if expression1 is greater than or equal to expression2. May be placed before or between the two expressions to be compared. If the expression is complex (is a chain of primitives, procedures or mathematical operations), it needs to be surrounded by brackets ().


<=

conditionals and flow

expression <= expression

boolean

Returns 1 (true) if expression1 is less than or equal to expression2. May be placed before or between the two expressions to be compared. If the expression is complex (is a chain of primitives, procedures or mathematical operations), it needs to be surrounded by brackets ().


!=

conditionals and flow

expression != expression

boolean

Returns 1 (true) if expression1 is not equal to expression2. May be placed before or between the two expressions to be compared. If the expression is complex (is a chain of primitives, procedures or mathematical operations), it needs to be surrounded by brackets ().


()

grammar

(expressions…) (comparisons…)

none

Placed around complex expressions or comparisons to ensure proper order of processing.

if (9 + 3 / :container) > (2 * 97) [...]


[]

grammar

[listitem1 listitem2 (listitem3…)]

list

Contains a list of items, for example requests, words or numbers. These are not

evaluated unless parsed for execution, for example in a repeat.

[forward 20 right 90]
[12 34 56 78]
[pig duck cow frog]


{}

grammar

{listitem1 listitem2 (listitem3…)}

list

An evaluated list contains a list of words, lists and functions that are evaluated prior to processing. Useful for making a list from the results of functions, which can then be passed other functions. Note: when storing an evaluated list into a container, the list items are generated at the time the list is stored, and are static from that point onward, in contrast with runtime-evaluated expressions, which are dynamic and updated whenever the container is recalled.

make "myposition {xpos ypos zpos}
show :myposition
[0 80 0]


about

environment

none

word

About returns the description of the current turtleSpace. See setabout

show about
This is my turtleSpace


abs

mathematics

number

absolute-number

Returns the absolute (non-negative) value of the input provided.

pr abs -54
54


addto

environment

procedurename

none

Continues line-entry mode of an existing procedure.

addto "existingprocedure


advancemusic

sound and music

none

none

Advances (and plays) one line of a currently paused music track. You can use advancemusic to programmatically control the tempo of a song (typically inside a worker), to speed it up or slow it down as required.

advancemusic


after

control

time-in-milliseconds (number) | requests (list)

none

After the specified amount of time the list of requests is performed by the current turtle in a new thread.

after 1000 [print [One second has passed.]]


afterp

boolean

word1 | word2

boolean

afterp outputs true if word1 comes after word2. To make the comparison, Logo uses the ASCII codes of the characters in the words. Note that all uppercase letters come before all lowercase letters. See beforep

show afterp "bread "apple
TRUE


age

control

none

none

Returns the age of the current turtle in milliseconds. Reset it with resetage

show age
show snappy:age


allopen

input and output

none

list

Returns a list of all open files. See open

show allopen


ambient

turtles

none

list

Returns the turtle’s ambient light values, if the turtle is acting as a light. See setambient

show ambient


amigaball ab

shapes and graphics

radius (number) | stacks (number) | sectors (number)

none

Creates an ‘Amiga ball’, a sphere that alternates sectors between the pen color and the fill color.

amigaball 50 10 20


amigaballoid abo

shapes and graphics

radius (number) | stacks (number) | sectors (number) | ratio (number)

Creates a stretched or flattened Amiga ball, based on the supplied ratio. Respects setspheroidaxis

amigaballoid 50 10 20 0.5


anchor

movement and vectors

none

list

Returns the location of the current anchor. The anchor is the ‘pivot point’ of the orbit commands and pullin / pullout.

show anchor


and

conditionals and flow

comparison1 comparison2 (comparison1 comparison2 comparison3…)

boolean

Returns 1 (true) if both the provided expressions are also true 0 (false) if not.

print and 5 = 4 3 = 2
0

if and 1 = 1 2 = 2 [print [Both are true!]]
Both are true!

if (and 1=1 2=2 3=3) [print [All are true!]]
All are true!


answer

input and output

none

word, number or list

Returns the last answer typed by the user as a response to a question. See question.

question [What is your name?]
make "username answer


api

environment

none

none

Enables the socket-based API on port 1967. The API allows you to control turtleSpaces remotely (using telnet) and / or from another application. Multiple connections may be employed simultaneously. Instructions given over the API are executed as the ‘apiX’ worker unless specified, where X is the connection instance, in the order of connection. To output (print, type etc) to the connection, one must call setwrite “api from the API connection, which directs output to that connection. See noapi, which disables the api

api


appendtrack

shapes and graphics

“turtlea (word) | “turtleb (word)

none

Appends “turtlea’s track (its movements and graphics) to the end of “turtleb’s track. See copytrack

appendtrack "myrtle "bob


apply

words and lists

template | inputlist

output

Runs the “template,” filling its slots with the members of “inputlist.” The number of members in “inputlist” must be an acceptable number of slots for “template.” It is illegal to apply the primitive TO as a template, but anything else is okay. APPLY outputs what “template” outputs, if anything.

print apply [[x] :x+5] [5]
10


approximatep

boolean

number | number

boolean

Returns true if the rounded value of the first number is the same as the rounded value of the second number. Similar to ~. See round

show approximatep 5.4 4.8
TRUE


arc

shapes and graphics

degrees | radius

none

Creates an arc. The arc is created around the turtle, and the turtle does not move. For arcs the turtle moves along, see leftarc, rightarc

arc 90 20


arccos

mathematics

number

number

Returns the inverse cosine of the provided number. The number must be between -1 and 1.

show arccos 0.2


arcsin

mathematics

number

number

Returns the inverse sine of the provided number. The number must be between -1 and 1.

show arcsin 4


arctan

mathematics

number

number

Returns the arctangent (inverse) of number in degrees.

print arctan 50
88.854199


array

words and lists

number

list

Creates a list with ’empty’ items of the given number. Once the list is created, you can replace the empty items using replace, for example

show replace 2 array 4 "frog


around

movement and vectors

position (list) | vector (list) | length (number) | radius (number)

turtles (list)

Returns a list of turtles within the cylinder created by the given parameters, in the direction indicated by the vector away from the position with the given length and radius. Useful for collision detection. See also inside, encroaching.

snappy:show without turtle around position forwarddir 200 20
[myrtle]


arrowcolor

turtles

none

color

Returns the color of the arrow that indicates the turtle’s direction. See setarrowcolor, showarrow, hidearrow

show arrowcolor


arrowdistance

turtles

none

distance

Returns the distance of the turtle’s directional arrow from the turtle. See setarrowdistance, showarrow, hidearrow

show arrowdistance


arrowp

boolean

none

boolean

Returns true if the directional arrow is enabled. See showarrow, hidearrow

show arrowp


arrowsize

turtles

none

size

Returns the size of the directional arrow. See setarrowsize, showarrow, hidearrow

show arrowsize


ascii

text

character

number

Returns the ASCII (American Standard Code for Information Interchange) index value for the specified character.

print ascii "A
65


ask

control

word or list | list

Creates new workers for each specified turtle in the word or list, and causes them to execute the instructions in the following list. Existing workers are not interrupted and as such they may conflict!

ask “myrtle [fd 20]

ask [myrtle snappy] [fd 20]


assemble

environment

procedure (word)

none

assemble turns the calling turtle’s ‘track’ (its movements and graphics) into a procedure. This is useful for turning ‘sketched out’ designs and objects into procedures for replication later. Note that the procedure created by assemble is not optimised for repetition because the track has no notion of it, so for example if you make a square using REPEAT [FD 20 RT 90], then use assemble, the assembled procedure will read FD 20 RT 90 FD 20 RT 90 etc.

assemble "mydesign


attenuate

sound and music

none

none

Turns on attenuation of the calling turtle’s sound output. See setattenuation, noattenuate

attenuate


attenuatep

boolean

none

boolean

Returns true if the calling turtle is currently attenuating its sound.

show attenuatep


attenuation

sound and music

none

number

Returns the attenuation value, which is 0.3 by default. This value affects all turtles that attenuate. See setattenutation, attenuate

show attenuation


audiowait

sound and music

none

none

Causes toot, noise and playsound to ‘block’ or hold up turtle execution while they play. See noaudiowait

audiowait


audiowaitp

boolean

none

boolean

Returns true if autowait is set on. See audiowait

show audiowaitp


autosave

input and output

none

filepath (word)

Returns the path and filename of the most recent autosave such that ‘load autosave’ will load the current project’s most recent autosave into the workspace.

load autosave


back bk

movement and vectors

turtlesteps (number)

none

Moves the current turtle back the specified number of turtle steps.

back 20


backgroundshade

environment

none

number

Returns the background shade. See setbackgroundshade

show backgroundshade


backspace

text

none

none

Moves the cursor one space to the left and deletes its contents.

backspace


backtrack bt

turtles

none

none

Backtrack deletes the last entry in the current turtle’s track, that is, it undoes the last movement the current turtle made, the last turtle-specific setting that was changed (such as setpencolor) or the last object the turtle created.

backtrack


backgroundcolor screencolor bg

environment

none

number

Returns the current background color.

print backgroundcolor
0


backgroundshade

shapes and graphics

none

shade (number)

Returns the current background shade value. See setbackgroundshade

show backgroundshade


beep

sound and music

none

none

Triggers the system beep.

beep


beforep

boolean

word1 | word2

boolean

beforep outputs true if word1 comes before word2. To make the comparison, Logo uses the ASCII codes of the characters in the words. Note that all uppercase letters come before all lowercase letters. See afterp

show beforep "bread "apple
FALSE


begintag

shapes and graphics

name (word)

none

Begins a ‘tag’, that is a grouping of movements, turtle parameter changes and shapes present in the calling turtle’s ‘track’, or output. The tag is closed with endtag. These tagged groups can be used for creating turtle models using newmodel, can be hidden or shown using hidetag or showtag, or copied using copytag

begintag "newtag


billboard

shapes and graphics

name (word) | dimensions (list)

none

Creates a ‘billboard’ using the specified image and the specified list of dimensions [x y]. See sample

billboard "marquee [100 200]


blocks

environment

none

none

Turns on ‘blocks’ mode (in development, mostly broken)

blocks


blocksp

boolean

none

boolean

Returns true if blocks mode is enabled.

show blocksp


box

shapes and graphics

size (number)

none

Creates a lined square of the specified size.

box 20


break

control

none

none

‘Breaks’ or exits from the current loop, for example repeat or foreach, and continues execution.

repeat 10 [print repcount if repcount = 5 [break]] print "Broken!
1
2
3
4
5
Broken!


bury

environment

procedure or [procedures]

none

Buries the provided procedures. Certain primitives such as ERALL, ERPS, POALL, POPS, POTS EXPORT and SAVE act on everything in the workspace except for procedures that are buried

bury "proc


buryall

environment

none

none

Buries all of the procedures and container names in the workspace. See bury

buryall


buryname

containers

name or [list]

none

Buries the provided container names.

buryname "container


butfirst bf

words and lists

word or list

word or list

Returns the provided word or list with all elements except the first. See butlast

show butfirst [dog pig cow]
[pig cow]

show butfirst "spot
pot


butlast bl

words and lists

word or list

word or list

Returns the provided word or list with all elements except the last. See butfirst

show butlast [dog pig cow]
[dog pig]

show butlast "spot
spo


butnumbers

words and lists

list

list

Returns a list containing only those elements that are not numbers.

show butnumbers [frog 12 cow 1234]
[frog cow]


butsearch

words and lists

searchmask (word) | list

list

Returns the provided list minus the elements matched by the provided search mask. See search

show butsearch "*g [frog duck pig]
[duck]


buttonp

boolean

button (number)

boolean

Returns true if the specified button is pressed. 0 is the left mouse button or joypad button 0, 1 is the right mouse button or joypad button 1

show buttonp 0


calm

control

turtle (word)

turtles (list)

none

Stops all workers running in the specified turtle(s). See halt

calm "snappy
calm [snappy myrtle]


cam

turtles

none

none

Returns the current camera (view) turtle.

cam:forward 20


camcontrol

environment

none

none

Enables a mode whereby you can move the camera turtle in various ways using the mouse. Clicking and dragging orbits the turtle’s anchor point. Right-clicking and moving up and down or vertical scrolling up and down pulls the turtle in or out from the anchor point. Right-clicking and moving left or right or horizontal scrolling rotates the turtle left or right. See nocamcontrol

camcontrol


camcontrolp

boolean

none

boolean

Returns true if camcontrol is enabled.

show camcontrolp


case

conditionals and flow

word, longword, number, boolean or list | list

none

Compares the input with the container specified by the previous switch primitive, and if true performs the contents of the list provided. See case, otherwise

case "yes [print |Welcome aboard!|]


caseinsensitive

words and lists

none

none

Makes search, sort and comparisons case insensitive. These are case sensitive by default. See nocaseinsensitive

caseinsensitive


caseinsensitivep

boolean

none

boolean

Returns true if nocaseinsensitive is enabled.

show caseinsensitivep


catalog cat

input and output

none

none

Opens the project catalog

cat


catch

conditionals and flow

name | list

none

Catch executes the provided list. If throw <name> is called while the provided list is run, control returns to the first statement after the catch. If you provide “error as the name, catch catches errors instead.

catch "duck [repeat 100 [fd 20 throw "duck]] pr "quack
catch "error [repeat 100 [fd 20


caught

movement and vectors

none

number

Returns a value if the calling turtle passes a fence or wrap threshold. caught returns 1 if the turtle hits / passes the X1 threshold provided to wrap / fence, 2 if X2, 3 if Y1, 4 if Y2, 5 if Z1, 6 if Z2. clearcaught resets it to 0.

show caught


cell

tables

table (word) | [row column (sheet)]

value

Returns the value stored in the specified table at the specified row, column, and sheet (if provided). See putcell

show cell "table [3 4]
20


center

text

none

none

Centers any text output using print.

center


char

text

ASCII value (number)

character

Returns a character with the specified ASCII value.

show char 84
T


circle cir

shapes and graphics

radius

none

Creates a lined circle at the specified radius around the turtle

circle 50
repeat 18 [circle 50 rr 10]


clamp

mathematics

number (number) | floor (number) | ceiling (number)

number

Clamp takes the inputted number, and if it is lower than the floor, or higher than the ceiling, it returns the floor or the ceiling respectively.

print clamp 10 5 20
10

print clamp 1 5 20
5

print clamp 30 5 20
20


clean

shapes and graphics

none

none

Erases the ‘turtle track’ (graphics) belonging to the current turtle without changing its position or state. Useful when a turtle is not actually drawing graphics but is itself a graphic element (for example, in a game) to ensure that its movements don’t build up in its track and slow down execution. To use clean in this context, simply place it at the end of the turtle’s “run loop”.

clean


cleanspace

shapes and graphics

none

none

Cleans all turtles in the current space. See clean

cleanspace


clearanswer

input and output

none

none

Clears the ‘answer’ parameter, which contains the input value from the previous ‘question’. See question, answer.

clearanswer


clearchar

input and output

none

none

Clears any buffered keyboard presses. See readchar, peekchar

clearchar


cleardatabase

containers

database (word)

none

Clears the given database. Unlike erasedatabase, the database is still defined. See newdatabase

cleardatabase "mydb


cleardictionary

containers

dictionary (word)

none

Clears the given dictionary. Unlike erasedictionary, the dictionary is still defined. See enter, lookup, newdictionary, erasedictionary, dictionary, dictionaryp, copydictionary, savedictionary, loaddictionary

cleardictionary "mydict


clearfrag

movement and vectors

none

none

Clears the current list of frag points. See frag

clearfrag


clearhistory

environment

none

none

Clears the interactive prompt’s history.

clearhistory


clearimage

shapes and graphics

imagename (word)

none

Clears the specified image from memory.

clearimage "image


clearimages

shapes and graphics

none

none

Clears all iamges from memory.

clearimages


clearmodel

shapes and graphics

modelname (word)

none

Removes the specified model from memory.

clearmodel "model


clearmodels

shapes and graphics

none

none

Removes all user-defined models from memory.

clearmodels


clearmusic

sound and music

none

none

Clears all music from memory.

clearmusic


clearplot

shapes and graphics

name (word)

none

Clears the named plot. See plot

clearplot "myplot


clearscreen cs

shapes and graphics

none

none

Clears the turtle’s ‘turtle track’ and sends the turtle to its home position.

clearscreen


clearsector

environment

none

none

Clears the name / value pairs (keys) out of the current sector. See zone

clearsector


clearsong

sound and music

musicname (word)

none

Clears the specified song (music) from memory.

clearsong "mymusic


clearsound

sound and music

soundname (word)

none

Clears the specified sound from memory.

clearsound "mysound


clearsounds

sound and music

none

none

Clears all user-defined sounds from memory.

clearsounds


cleartext ct

text

none

none

Clears the text area.

cleartext


clearuser

environment

none

none

Unsets the current user, sets environment to no user. See createuser

clearuser


clearzones

environment

none

none

Clears (removes) all of the defined zones from the current space.

clearzones


clonetag

shapes and graphics

sourcetagname (word) | copytagname (word)

none

Clones a turtle’s tag and puts the new copy at the end of its ‘turtle track’. See tag

clonetag "oldtag "newtag


cloneturtle

turtles

sourceturtle (word) | destinationturtle (word)

none

Clones a turtle.

cloneturtle "myrtle "max


close

input and output

filename (word)

none

Closes the specified file. See open

close "file


closeall

input and output

none

none

Closes all files that are currently open. See open, close

closeall


co

control

none

none

Continues execution if that execution was halted by the pause primitive. See pause.

co


colchar

text

color index (number)

none

Inserts a ‘color character’ into a word, which when printed changes the foreground color of the subsequent text in the word to that color. A color character cannot be a list item unto itself (it will return an error).

print word colchar 4 "duck


collisionp

boolean

turtle (word) | distance (number)

boolean

Returns true if the specified turtle is within the specified distance of the calling turtle. See distance

show collisionp snappy 200
TRUE


color

shapes and graphics

number

list

color returns the red, green and blue values of the specified color

show color 5
[128 128 128]

show color brown
[128 80 0]


colors

shapes and graphics

none

list

Returns a list of lists containing all of the colors’ RGB values in order of color index, eg with the first list being [0 0 0] (black) and the 16th list being white [255 255 255]. For an easier-to-read version, see listcolors

show colors


column

tables

table (word) | column (number)

list

Returns the contents of the specified column in the specified table as a list. See row

show column "table 5


cone cn

shapes and graphics

radius (number) | depth (number) | sides (number)

Creates a cone pointing downward from and centered on the calling turtle.

cone 20 10 20


coneslice csl

shapes and graphics

radius (number) | depth (number) | sidestotal (number) | sidesused (number)

none

Creates a sliced cone.

coneslice 20 20 20 10


conoid cno

shapes and graphics

radius (number) | depth (number) | sides (number) | ratio (number)

Creates a conoid, a cone stretched or compressed based on the provided ratio (1 is normal, 2 is stretched twice as much, 0.5 half as much, etc.)

conoid 20 40 20 2


conoidslice cosl

shapes and graphics

radius (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)

none

Creates a sliced conoid.

conoidslice 20 20 20 10 2


consonantp

boolean

word

boolean

Returns true if the first letter of the supplied word is a consonant. Y is considered a vowel. See vowelp

show consonantp "x
TRUE


contains

words and lists

word or list | list

Returns the index of the first list item matched by the provided word or list. See containsp

show contains “frog [duck frog pig]

2


containsp

boolean

word or list | list

boolean

Returns true if the specified word exists as an item in the specified list. See contains

show containsp "frog [pig duck frog]
true


control

control

turtle (word) | primitives (list)

none

Executes the specified primitives using the specified turtle in the thread that calls the control primitive. Same as executing turtle:run [do these things], but easier to automate, for example: foreach “turtle everyone [control :turtle [fd 10]]

control "snappy [orbitleft 20]


copydatabase

containers

source | destination

none

Copies a database with the name source to another database with the name destination. See database, newdatabase

copydatabase "from "to


copydef

turtles

sourceprocedure (word) | procedurecopy (word)

none

Copies a procedure inside a turtle to a procedure with the provided name

copydef "procedure "procedurecopy


copydictionary

containers

source | destination

none

Copies a dictionary with the name source to another dictionary with the name destination. See dictionary, newdictionary

copydictionary "from "to


copyfile

input and output

source (word) | destination (word)

Copies the specified file to the specified destination.

copyfile “myfile “myfile2


copyproc

turtles

procedure (word) | target (word)

none

Copies a procedure from the calling turtle to the target turtle

copyproc "procedure "turtle


copytag

shapes and graphics

tag (word) | turtle (word)

none

Copies a tag from the calling turtle to the named turtle, at the end of the named turtle’s turtle track.

copytag "tag "turtle


copytrack

shapes and graphics

“turtlea (word) | “turtleb (word)

none

Copies “turtlea’s track (its movements and graphics) to “turtleb, overwriting “turtleb’s existing track. See appendtrack

copytrack "myrtle "bob


cos

mathematics

input (number)

output (output)

Returns the cosine of the input. See sin

show cos 120
-0.50000077735


count

words and lists

word or list

number

Returns the number of characters or items in the provided word or list, respectively.

show count "frog
4

show count [pig duck frog]
3


createdir

input and output

directory

none

Creates a new directory in the current path.

createdir "newdir


createuser

environment

name (word)

none

Creates a new user with the specified name.

createuser "Bonnie


creators

environment

list

none

Creators contains an auto-generated list of the turtleSpace’s creators for use by the catalogue. It is metadata and cannot be retrieved by code. It should not be manually modified. See about

creators [Bonnie]


crossmap

words and lists

template | list

list

outputs a list containing the results of template evaluations. Each data list contributes to a slot in the template; the number of slots is equal to the number of data list inputs. As a special case, if only one data list input is given, that list is taken as a list of data lists, and each of its members contributes values to a slot. CROSSMAP differs from MAP in that instead of taking members from the data inputs in parallel, it takes all possible combinations of members of data inputs, which need not be the same length.

show (crossmap [word ?1 ?2] [a b c] [1 2 3 4])
[a1 a2 a3 a4 b1 b2 b3 b4 c1 c2 c3 c4]


csall

shapes and graphics

none

none

Causes all turtles to clear their turtle tracks and return to their starting positions.

csall


cube cb

shapes and graphics

size

none

Creates a wireframe cube of the specified size

cube 20


cuboid cbo

shapes and graphics

width | height | depth

none

Creates a wireframe cuboid of the specified dimensions

cuboid 30 20 10


cursor

text

none

none

Returns the position of the text cursor.

show cursor


cursorchar

text

none

character (word)

Returns the current cursor character. See setcursorchar

show cursorchar


cursordown cd

text

none

none

Moves the text cursor down one.

cursordown


cursorhome

text

none

none

Returns the cursor to the left side of the text area.

cursorhone


cursorleft cl

text

none

none

Moves the text cursor one to the left.

cursorleft


cursorright cr

text

none

none

Moves the text cursor one to the right.

cursorright


cursorup cu

text

none

none

Moves the text cursor up one.

cursorup


cutcone cc

shapes and graphics

radiusnear (number) | radiusfar (number) | depth (number) | sides (number)

none

Creates a truncated, or cut, cone. See cone

cutcone 10 20 30 30


cutconeslice ccs

shapes and graphics

radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number)

none

Creats a cut, sliced cone. See coneslice

cutconeslice 20 40 20 20 10


cutconoid cco

shapes and graphics

radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio (number)

none

Creates a truncated, or cut, conoid, stretched based on the provided ratio. See conoid

cutconoid 10 20 30 30 2###


cutconoidslice ccos

shapes and graphics

radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)

none

Creates a cut, sliced conoid, stretched based on the provided ratio. See conoid

cutconoidslice 10 20 30 30 15 2


cutfunnel cf

shapes and graphics

radiusnear (number) | radiusfar (number) | depth (number) | sides (number)

none

Creates a cut funnel (an uncapped cut cone).

cutfunnel 20 10 20 20


cutfunneloid cfo

shapes and graphics

radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio (number)

none

Creates a cut funneloid (an uncapped cut conoid).

cutfunneloid 20 30 20 20 0.5


cutfunneloidslice cfos

shapes and graphics

radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)

none

Creates a cut, sliced funneloid (an uncapped cut conoid).

cutfunneloidslice 20 30 20 20 10 0.5


cutfunnelslice cfs

shapes and graphics

radiusnear (number) | radiusfar (number) | depth (number) | sidestotal (number) | sidesused (number)

none

Creates a sliced, cut funnel (an uncapped cut cone).

cutfunnelslice 20 10 20 20 10


cutsphere csp

shapes and graphics

radius (number) | stacks (number) | sectors (number) | minstack (number) | maxstack (number)

none

Creates a truncated, or cut, sphere. Can be cut on the top, bottom, or both based on specified minstack and maxstack values. See sphere

cutsphere 30 14 32 4 13


cutsphereslice css

shapes and graphics

radius (number) | stacks (number) | totalsectors (number) | minstack (number) | maxstack (number) | usedsectors (number)

none

Creates a sliced and cut sphere. Can be cut on the top, bottom, or both based on specified minstack and maxstack values. Displays the portion specified by totalsectors and usedsectors. See sphereslice, cutsphere

cutsphereslice 30 20 20 5 15 10


cutspheroid cso

shapes and graphics

radius (number) | stacks (number) | sectors (number) | minstack (number) | maxstack (number) | ratio (number)

none

Creates a truncated, or cut, sphere, stretched by the provided ratio. Can be cut on the top, bottom, or both based on specified minstack and maxstack values. See spheroid

cutspheroid 30 14 32 4 13 0.5


cutspheroidslice csos

shapes and graphics

radius (number) | stacks (number) | totalsectors (number) | minstack (number) | maxstack (number) | usedsectors (number) | ratio (number)

none

Creates a sliced and cut spheroid. Can be cut on the top, bottom, or both based on specified minstack and maxstack values. Displays the portion specified by totalsectors and usedsectors. Is stretched by the ratio provided. See spheroidslice, cutspheroid

cutspheroidslice 30 20 20 5 15 10 2


cylinder cy

shapes and graphics

radius (number) | depth (number) | sides (number)

none

Creates a cylinder

cylinder 20 30 10


cylinderarc cya

shapes and graphics

thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number)

none

Creates a partial torus, or curved cylinder.

cylinderarc 5 15 20 20 10


cylinderarcslice cyas

shapes and graphics

thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides (number)

Creates a slice of a partial torus, or curved cylinder. Note: If you invert the thickness value, you can ‘slice’ the opposite side.

cylinderarcslice 5 15 20 20 10 5 15


cylinderslice cys

shapes and graphics

radius (number) | depth (number) | totalsides (number) | slicesides (number)

none

Creates a rounded wedge shape, like a slice of a round of cheese, starting at the turtle’s right vector and moving counter-clockwise.

cylinderslice 20 10 20 10


cylindroid cyo

shapes and graphics

radius (number) | depth (number) | sides (number) | ratio (number)

none

Creates a cylindoid

cylindroid 20 30 10 2


cylindroidarc cyoa

shapes and graphics

thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | ratio (number)

none

Creates a cylinder arc extruded by the provided ratio.

cylindroidarc 5 15 20 20 10 2


cylindroidarcslice cyoas

shapes and graphics

thickness (number) | radius (number) | totalsides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides | ratio (number)

none

Creates a cylinder arc sliced by the provided sides values and extruded by the provided ratio.

cylindroidarcslice 5 15 20 20 10 10 15 2


cylindroidslice cyos

shapes and graphics

radius (number) | depth (number) | totalsides (number) | slicesides (number) | ratio (number)

none

Creates a stretched rounded wedge shape, like a slice of a round of cheese, starting at the turtle’s right vector and moving counter-clockwise, and stretched using the provided ratio, where 1 is normal, 0.5 is half, 2 is double etc.

cylindroidslice 20 10 20 10 0.5


database

containers

databasename (word)

contents

Outputs a list containing the contents of the specified database in the format [key1 [container1 [values] container2 [values]…] key2…] See newdatabase

show database "mydb


databasep

boolean

databasename (word)

boolean

Returns true if the given databasename is a defined database. See newdatabase

show databasep "mydb


dawdle

control

none

none

Waits until all of the turtle’s workers except for its ‘main’ one and / or hatchlings finish executing.

newworker [repeat 100 [wait 1]] dawdle print |Done waiting.|


day

environment

none

number

Returns the current day of the month.

show day
22


debug

environment

none

none

Turns on debugging. Debug output is logged to the console / terminal that executes turtleSpaces, so if you need debugging you need to launch it from a console / terminal. Further, debug needs to be used as a prefix from the interactive mode prompt, eg debug myprimitive, otherwise it can be called from inside an primitive and applies to the executing thread.

debug


debugp

boolean

none

boolean

Returns true if debug is enabled.

show debugp


dec

mathematics

word

none

Decreases the value of the specified container (variable) by one. Note that the container (variable) specified by dec begins with a quote (“) not a colon. This is so that you can pass dec a container specified inside another container. See inc

make "counter 10
dec "counter
print :counter
9

will decrement the container named counter by one.

make "fred 5
make "counter "fred
dec :counter
print :fred
4

will decrement the container specified by :counter ("fred) by one.


define

environment

procedurename (word) | procedure (list)

none

define creates a new procedure of the given procedurename containing the primitives described by the provided list, in the format [[:parameter1 :parameter2] [primitive1 primitive 2 primitive3…]]

define "newprocedure [[:size] [repeat 4 [fd :size rt 90]]]


definecolor dfw

shapes and graphics

index (number) | list or word

none

definecolor takes an index number from 0 to 63 and either a list of three values (representing red, green, and blue) with a value from 0 to 100, or a 6-character word representing a color’s RGB values in hexadecimal format, for example ab1274. The color palette defined by definecolor is used for pen and fill colors. For text colors see definetextcolor

definecolor 20 [50 20 90]
definecolor 21 "ab1274


definedp

boolean

procedurename (word)

boolean

Returns TRUE if the provided procedurename is the name of a defined procedure.

show definedp "myprocedure
TRUE


definetextcolor

text

index (number) | list or word

none

definetextcolor takes an index number from 0 to 63 and either a list of three values (representing red, green, and blue) with a value from 0 to 100, or a 6-character word representing a color’s RGB values in hexadecimal format, for example ab1274

definetextcolor 20 [50 20 90]
definetextcolor 21 "ab1274


delete

input and output

file (word)

none

Deletes the specified file from the current turtleSpace. For safety, delete can only delete files from the root of the turtleSpace.

delete "myfile


deleteoverlay

shapes and graphics

name (word)

none

Deletes the named overlay.

deleteoverlay "myrtlesview


deleteplot

shapes and graphics

name (word)

none

Deletes the named plot. See plot

deleteplot "myplot


deletespace

environment

word

none

Removes the space of the given name.

deletespace "myspace


deletesticker

shapes and graphics

name (word)

none

Deletes the sticker with the specified name. See placesticker.

deletesticker "marquee


dequeue

containers

container

item

Similar to pop, except removes the item from the end of the list. See pop

show dequeue "container


dictionary

containers

dictionary (word)

list

Returns a list containing the contents of the given dictionary. See enter, lookup, erasedictionary, cleardictionary, newdictionary, dictionaryp, copydictionary, savedictionary, loaddictionary

show dictionary "mydict


dictionaryp

boolean

dictionary (word)

boolean

Returns true if the specified dictionary is currently defined. See dictionary, newdictionary

show dictionaryp "mydict


die

control

none

none

die halts the thread that calls it. Useful for terminating execution arbitrarily, although it should be done more gracefully, where possible.

die


difference

mathematics

number1 (number) | number2 (number)

number

Difference outputs the result of subtracting number 2 from number 1.

show difference 5 1
4


diffuse

turtles

none

list

Returns a list of the diffuse light values, if the turtle is a light. See setdiffuse

show diffuse


direction

movement and vectors

position (list)

vectors (list)

Returns a list of vectors that would point the calling turtle at the supplied list of co-ordinates.

show direction myrtle:position snappy:position
[[0 1 0] [0 0 1] [1 0 0]]

snappy:setvectors direction myrtle:position


displaysize

environment

none

list

Returns the size of the display currently displaying the turtleSpaces window. See windowpos, windowsize, setwindowpos, setwindowsize

show displaysize


distance

movement and vectors

position (list) | position (list)

distance (number)

Returns the distance from the first given set of co-ordinates to the second given set of co-ordinates.

show distance myrtle:position snappy:position
show distance [0 0 0] [100 100 100]


divergence

movement and vectors

[vector1 vector2] (list) | [vector3 vector4] (list)

degrees (number)

Divergence returns the degrees of difference (divergence) between vector1 and vector3 in a clockwise direction, that direction established using vector2 and vector4, which need to be the axis you would be pivoting on to measure that difference. So if you’re measuring the degrees of difference between two forward vectors in terms of left and right, the second vector needs to be the up vector. If you were measuring the difference in terms of up and down, you would give the right vector. Divergence is extremely useful for ball games.

show divergence {item 1 myrtle:vectors item 3 myrtle:vectors} {item 1 snappy:vectors item 3 myrtle:vectors}
90


divisorp divp

boolean

numerator (number) | denominator (number)

boolean

returns true of the numerator divides evenly into the denominator. See remainder,

show divisorp 5 20
true


dodecahedron dod

shapes and graphics

size (number)

none

Creates a dodecahedron (12-sided shape) of the specified size.

dodecahedron 5


dodecahedroid dodo

shapes and graphics

size (number) | ratio (number)

none

Creates a dodecahedroid (12-sided shape) of the specified size and stretched using the specified ratio.

dodecahedroid 5 2
dodecahedroid 10 0.5


dome dm

shapes and graphics

radius (number) | stacks (number) | sectors (number)

none

Creates a dome

dome 20 10 10


domoid dmo

shapes and graphics

radius (number) | stacks (number) | sectors (number) | stretch (number)

none

Creates a stretched dome.

domoid 20 10 10 2


doppel

shapes and graphics

modelname (word)

none

Like stamp, except creates a reference to the provided model rather than copying the model into the turtle track. This means that if the model changes, its doppel representation will also change.

doppel "myrtle


dosleep

conditionals and flow

milliseconds (number) | list

none

Performs the provided list of instructions and then sleeps if and until the provided number of milliseconds has passed since the list started execution

dosleep 1000 [print "hello!]


dot

shapes and graphics

[x y (z)] (list)

none

Puts a dot at the specified co-ordinates using the specified _pen_ color (this is for Apple Logo compatibility). If z is not specified, z = 0. Dots are removed by clean, clearscreen. See dots, dotp, dotsize.

dot [10 10]


dotp

boolean

[x y (z)] (list)

none

Returns true if there is a dot at the specified co-ordinates. Dots are turtle-specific, and so dotp will only detect the calling turtle’s dots.

show dotp [10 20 30]


dots

shapes and graphics

none

list

Returns a list of the co-ordinates of all the dots currently in the calling turtle’s turtle track. See dot, dotp

show dots


dotsize

shapes and graphics

none

size (number)

Returns the calling turtle’s current dot size. See setdotsize, dot, dotp.

show dotsize


dountil

conditionals and flow

expression | instructions (list)

none

Repeats the provided list of instructions until the provided expression is true.

make "counter 0 dountil :counter = 5 [make "counter :counter + 1 print :counter]
1
2
3
4
5


dowhile

conditionals and flow

expression | instructions (list)

none

Repeats the provided list of instructions while the provided expression is true.

make "counter 0 dowhile :counter < 5 [make "counter :counter + 1 print :counter]
1
2
3
4
5


down dn

movement and vectors

degrees (number)

none

Tilts the calling turtle’s nose down by the given number of degrees. See up

down 45


dragselect

environment

none

none

Allows text to be selected and copied to the clipboard by clicking and dragging. See nodragselect

dragselect


dragselectp

boolean

none

boolean

Returns true if dragselect is enabled


drain

turtles

none

none

Empties the calling turtle’s message queue.

drain


dribble

input and output

file (word)

none

Sends a copy of the characters displayed on the screen to a file. nodribble stops it. See nodribble

dribble "mydribble.txt


dribblep

boolean

none

boolean

Returns true if turtleSpaces is currently dribbling. See dribble


drift

movement and vectors

steps vector

Causes the selected turtle to ‘drift’ the specified number of steps in the direction specified by vector. You can use drift to simulate momentum or gravity, particularly in concert with workers. See forwarddir

drift 10 forwarddir

forward 10 make "forward forwarddir newworker [repeat 5 [drift 1 :forward]]


dropanchor

movement and vectors

none

none

Sets the selected turtle’s orbit anchor point to its current position. See setanchor

repeat 10 [penup forward 60 dropanchor pullout 50 pendown repeat 36 [orbitleft 10]]


duocutconoid dcc

shapes and graphics

radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)

none

Creates a cut conoid with two different oid (stretch) ratios, one for each end. See cutconoid, duocutfunneloid

duocutconoid 20 30 20 20 0.5 2


duocutfunneloid dcfo

shapes and graphics

radiusnear (number) | radiusfar (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)

none

Creates a cut funneloid (an uncapped cut conoid) with two different oid (stretch) ratios, one for each end. See cutfunneloid

duocutfunneloid 20 30 20 20 0.5 2


duocylindroid dco

shapes and graphics

radius (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)

none

Creates a cylindroid with two different oid (stretch) ratios, one for each end. See cylindroid, duotuboid

duocylindroid 20 20 20 0.5 2


duotuboid dto

shapes and graphics

radius (number) | depth (number) | sides (number) | ratio1 (number) | ratio2 (number)

none

Creates a tuboid, or stretched tube, with two different oid (stretch) values, one for each end. Can be used to transition between non-oids and oids, or between two oids. See tuboid

duotuboid 10 20 20 0.5 2


e

mathematics

none

number

Returns the constant e, which is 2.7182818284590452353

show e


ed

environment

none

none

Opens the entire workspace in the editor. Can also be invoked with control-E. To open just one particular procedure, use edit

ed


edit

environment

procedure (word)

none

Invokes the editor and opens specified procedure. To edit the entire workspace, use ed

edit "bananas


editfile

input and output

filename (word)

none

Opens the specified file for editing in the editor.

editfile "myfile


edn

containers

containername (word)

none

Inserts a make statement into the prompt containing the specified container name and its contents for editing.

edn "container


edns

containers

containername(s) (list)

none

Opens the editor with a list of the provided containers and their contents, which are updated when the editor is exited.

edns [container1 container2]


ellipse ell

shapes and graphics

width (number) | height (number)

none

Creates a pen-drawn ellipse of the specified width and height.

ellipse 50 20


else

conditionals and flow

list

none

Executes the provided list of requests if the previous if comparison was false. else is not necessary if the list of requests immediately follows the list of requests specified for the true condition, but else allows for the requests to be executed later in the program flow.

if :container = 5 [do this] [do that]

else is not needed here, since if can take an else request list

if :container = 5 [do this]
print |I am the walrus|
else [do that]

but else can come later


empty

words and lists

none

nothing

Returns nothing. Used to ‘reset’ a container or list item to nothing (undefined).

make "container empty


emptylist

words and lists

none

none

Returns an empty list []

make "container emptylist


emptyp

words and lists

word or list item

boolean

Returns true if the provided word or list item is empty (blank).

print emptyp "
true


encroaching

movement and vectors

position (list) | vectors (list) | [left right forward backward above below] (list)

turtles (list)

Returns a list of turtles encroaching within the ‘box’ specified by the third list input. This is a more sophisticated version of inside, which allows for a box of any orientation, based on the provided vectors. See around, inside

show encroaching position vectors [10 10 10 10 10]


end

environment

none

none

Closes a ‘to’, a procedure definition. See to

end


endmark

shapes and graphics

none

none

Creates a half-oval “ending” mark. See mark, startmark

endmark


endrope

shapes and graphics

none

none

Creates a dome “end” to a rope. See rope, startrope

endrope


endtag

shapes and graphics

none

none

Closes the currently open tag. See tag

endtag


enter

containers

dictionary (name) | key (name) | value (word or list)

none

Associates the given value with the given key in the given dictionary. See newdictionary, lookup, erasedictionary, cleardictionary, dictionary, dictionaryp, copydictionary, savedictionary, loaddictionary

enter "mydict "stooges [moe larry curly]
enter "mydict "ducks 5


eofp

boolean

none

boolean

Returns true if the current reader is at the end of the file. See reader, writer

show eofp


erall

environment

none

none

Erases all procedures, variables and properties from the workspace.

erall


erase

environment

procedure (word)

none

Erases the specified procedure from the calling turtle’s workspace

erase "myprocedure


erasedatabase

containers

database (word)

none

Erases the given database. Unlike cleardatabase, the database is no longer defined. See newdatabase

erasedatabase "mydb


erasedictionary

containers

dictionary (word)

none

Erases the given dictionary. Unlike cleardictionary, the dictionary is no longer defined. See enter, lookup, newdictionary, cleardictionary, dictionary, dictionaryp, copydictionary, savedictionary, loaddictionary

erasedictionary "mydict


erasekey

environment

keyname (word)

none

Erases the provided key from the current sector, if that key exists. See zones

erasekey “key


eraselocal

containers

container (word)

none

Erases the named local container. See local

erase "localcontainer


erasefile

erasename ern

containers

container (word)

none

Erases the name off of a specified container (unallocating it), and empties its contents.

erasename "mycontainer


erasenames erns

containers

none

none

Erases the names off of all the containers held by the turtle that calls it, and empties their contents

erasenames


eraseprocs erps

environment

none

none

Erases all procs in the calling turtle. To erase all procs in all turtles see initialize

eraseprocs


eraseprivate

containers

container (word)

none

Erases the named private container. See private

eraseprivate "privatecontainer


eraseshare

containers

container (word)

none

Erases the specified shared container.

eraseshare "sharedcontainer


eraseshares

containers

none

none

Erases all shared containers and their contents.


erasetable

tables

table (word)

none

Erases the named table.

erase "mytable


erasetag

shapes and graphics

tag (word)

none

Erases the named tag and its contents.

erasetag "mytag


eraseturtle

control

name (word)

none

Erases the specified turtle

erase "fred


erprops

containers

none

none

Erases all property lists.

erprops


error

environment

none

sentence

Returns the text of the last error.

show error


equalp

boolean

expression | expression

boolean

Returns true if both supplied expressions are equal

show equalp 5 5
TRUE

show equalp 3 5
FALSE


escape

control

none

none

Allows the user to use the escape key to halt all execution. See noescape

escape


escapep

boolean

none

boolean

Returns true if escape is enabled

show escape


eval

conditionals and flow

list

output

evaluates the expression in the supplied list and returns its output.

show eval [10 + 2]
12


evenp

boolean

number

boolean

Returns true if the provided number is even (0, 2, 4, 6…)

show evenp 6


every

conditionals and flow

counter (number) | count (number) | instructions [list]

none

Performs the list of supplied instructions every time the supplied count divides equally into the supplied counter. Shorthand for IF REMAINDER COUNTER COUNT []

every repcount 10 [print “moo]


everyone

control

none

list

Returns a list of all turtles except Snappy, which is a camera-only turtle. Useful to use with foreach to iterate through a series of instructions with each turtle.

show everyone
["myrtle]


exchange

words and lists

index1 (number) | index2 (number) | word or list

word or list

Exchanges the item at index1 in the given word or list with the item at index2.

show exchange 1 2 [pig cow]
[cow pig]

show exchange 1 5 "solar
"rolas


export

input and output

name (word)

none

Saves an .lgo file with the provided name containing the current turtlespace code.

export "MyCode


extrapolate

movement and vectors

position (list) | vector (list) | distance (number)

list

Returns a list of target co-ordinates based on the starting position, a vector and the distance in turtle-units along that vector.

show extrapolate position forwarddir 5


face

position (list of 3) | position (list of 3)

vector (list)

face takes two lists of co-ordinates (x, y and z) and then returns a list of vectors (list of three lists of three) which if applied to a turtle cause it to ‘face’ the second set of co-ordinates if positioned at the first set of co-ordinates.

setvectors face position [100 100 100]


facingp

movement and vectors

boolean

co-ordinates (list) | degrees (number)

boolean

returns true if a vector from the calling turtle to the supplied co-ordinates diverges less than the supplied number of degrees from the calling turtle's forward vector. See divergence

reset
snappy:show facingp myrtle:position 10
true

myrtle:show facingp snappy:position 10
false


false

boolean

none

zero

Returns zero (false).

show false


fence

movement and vectors

none

none

Causes the calling turtle to halt if it reaches the screen boundaries set by setbounds. See setbounds, bounds, window, wrap, caught

fence


fencep

boolean

none

boolean

Returns true if the calling turtle is in fence mode. See fence

show fencep


filelen

input and output


filep

boolean

word

boolean

Returns true if the file specified by the given word exists.

show filep "myfile


files

input and output

none

[[list] [list]]

Returns a list of entries in the current directory divided into two lists: the first contains folders, the second files.

show files


fileselect

input and output

extension (word)

path

Takes an extension mask as input (without the .) and prompts the user to select a file, returning the path and file selected.

show fileselect “lgo


fill

shapes and graphics

none

none

Currently does nothing. This is OpenGL not Photoshop!


fillcolor

shapes and graphics

none

number

Returns the fill color currently used by the selected turtle.

print myrtle:fillcolor
7


fillshade fsh

shapes and graphics

none

shade (number)

Returns the current fillshade value. See setfillshade

show fillshade


fillopacity

shapes and graphics

none

opacity (number)

Returns the current fill opacity

show opacity


filter

words and lists

boolean function | word or list

word or list

Applies the provided boolean function to each character or list item in provided word or list.

print filter "consonantp "aardvark
rdvrk


find

words and lists

template [list] | inputs [list]

result

Find outputs the first constituent of the data input (the first member of a list, or the first character of a word) for which the value produced by evaluating the template with that constituent in its slot is TRUE. If there is no such constituent, the empty list is output.

In a template, the symbol ?REST represents the portion of the data input to the right of the member currently being used as the ? slot-filler. That is, if the data input is [A B C D E] and the template is being evaluated with ? replaced by B, then ?REST would be replaced by [C D E].

In a template, the symbol # represents the position in the data input of the member currently being used as the ? slot-filler. That is, if the data input is [A B C D E] and the template is being evaluated with ? replaced by B, then # would be replaced by 2.

to spellout :card
output (sentence (butlast :card) "of
(find [equalp last :card first ?]
[hearts spades diamonds clubs]))
end

print spellout "5d
5 of diamonds

print spellout "10h
10 of hearts


finish

control

none

none

Halts all threads in all turtles. Stops the world. Can be invoked by pressing the escape key, unless noescape has been invoked.

finish


first

words and lists

word or list

word or list

Returns the first item or character in a list or word. See last.

print first "frog
f

print first [frog pig duck]
frog


fiso

shapes and graphics

width height

none

Creates a filled isosceles triangle with the center of its base at the root of the selected turtle and aligned with the turtle’s orientation. See iso.

fiso 20 10


fixate fix

movement and vectors

position

none

Both sets the anchor point and points the selected turtle at it. Compare with setanchor, which does not change the orientation of the selected turtle.

snappy:fixate myrtle:position

fixate [0 0 0]

points Snappy (the camera turtle) at Myrtle.


flash

text

none

none

Causes subsequent text to flash. See inverse, normal.

flash


flat

words and lists

list

list

Takes all words inside the provided list and flattens them to a single level, removing any internal hierarchy.

show flat [pig duck [cow frog [chicken sheep]]]
[pig duck cow frog chicken sheep]


fluid

turtles

none

none

Turns on ‘fluid’ mode, which causes the turtle to move incrementally. See nofluid

fluid


fluidangle

turtles

none

number

Returns the fluid angle. See setfluidangle

show fluidangle


fluidp

boolean

none

boolean

Returns true if fluid is enabled in the calling turtle

show fluidp


fluidstep

turtles

none

number

Returns the fluid step value. See setfluidstep

show fluidstep


follow fo

turtles

turtle (word)

none

Causes the calling turtle to ‘follow’ the specified turtle. Can only be set if the turtle is the view (camera) turtle.

follow myrtle


following

turtles

none

turtle (word)

Returns the name of the turtle followed by the calling turtle, if any.

show following


followp

boolean

none

boolean

Returns true if the calling turtle is following another turtle

show followp


for

conditionals and flow

[container start end (optional step)] (list) | [instructions to run] (list)

none

Repeats the list of requests counting from the start value to the end value, incrementing the value of :container by one (or the optionally provided step value) each time. The value stored in container remains after the for loop has finished executing.

for [i 1 15] [print :i]
1
2
3
...

for [i 1 10 2] [print :i]
1
3
5
...


foreach

conditionals and flow

container (word) | word or [list of items] | [list of requests]

none

Repeats the list of requests once for each item in the list of items while also changing the value of the specified container to the list item currently being processed. Note that the container name begins with a ” not a : when using foreach. Also, the value of container remains after the foreach loop has finished executing.

foreach "animal [goose horse sheep] [print {[Old Macdonald had a] :animal [E I E I O]}]
foreach "char "duck [print :char]


forever

conditionals and flow

list of requests

none

Repeats the list of requests until terminated by another thread or halt.

forever [print [I am slowly going crazy 1 2 3 4 5 6 switch]]


fork

input and output

name (word)

none

Duplicates the current project and gives it the specified name, and switches to it as the currently active project. Note: If the project has a lot of files in it, this may take some time!

fork "forkedproject


form

words and lists

number (number) | field (number) | precision (number)

word

Form outputs the input number as a word inside the number of spaces indicated by field, with the number of digits after the decimal point indicated by precision. Spaces are added to the beginning of the word as necessary.

show form pi 10 2
3.14


forward fd

movement and vectors

turtle-spaces (number)

none

Moves the turtle forward the given number of turtle steps. Draws a line if the pen is down. See pendown, back

forward 20


forwarddir

movement and vectors

none

vector (list)

Returns the calling turtle’s forward vector.

show forwarddir


fput

words and lists

word | list

list

Returns the specified list with the specified word inserted in front.

show fput "cow [pig goat]
[cow pig goat]


fraction frac

mathematics

number

number

Returns the fractional part of a number. Similar to mod X 1 or X – int X. See mod, int

show frac 3.14
0.14


frag

shapes and graphics

none

none

Makes a triangle from the current position and previous two turtle positions.

forward 20 right 90 forward 20 frag


frameinterval

environment

none

milliseconds

(webLogo only) The interval between rendering cycles. This can speed up webLogo use when drawing complicated scenes. Set it with setframeinterval

show frameinterval


fullscreen [fs]

environment

none

none

Sets the graphics screen ‘fullscreen’, that is, turns off the text screen. The name of this primitive is a remnant from 8-bit computers which could only show either graphics or text in a particular area of the screen at one time. See also splitscreen textscreen overlayscreen

fullscreen


funnel fu

shapes and graphics

radius (number) | depth (number) | sides (number)

Creates a funnel (an uncapped cone).

funnel 20 20 20


funnelslice fus

shapes and graphics

radius (number) | depth (number) | sidestotal (number) | sidesused (number)

none

Creates a sliced funnel.

funnelslice 20 20 20 10


funneloid fuo

shapes and graphics

radius (number) | depth (number) | sides (number) | ratio (number)

Creates a funneloid (an uncapped conoid).

funneloid 20 20 20 0.5


funneloidslice fuos

shapes and graphics

radius (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)

none

Creates a sliced funneloid.

funneloidslice 20 20 20 10 2


gameaxis

input and output

axis

value

Returns a digital value (-1 0 1) of the specified gamepad axis. Note this only reads gamepads, not the mouse. For analog values use paddle

show gameaxis 1


gamebuttons

input and output

none

buttons

Returns a list of the buttons currently pressed on the gamepad.

show gamebuttons


gamebuttonp

boolean

buttom

boolean

Returns true if the specified gamepad button is currently pressed.

show gamebuttonp


get

containers

surname | container

value

Returns the value of the specified container under the given surname. See setsurname, set

show get "jones "car
camry


go

conditionals and flow

word

none

Jumps to the execution point marked by label with the specified word. Similar to the BASIC GOTO command. Should be avoided if at all possible. See label.

label "start
print |This will repeat forever!|
go "start


gprop

containers

name | property

value

Returns the value of the property in the named property list. See plist

show gprop "john "phone


gradient

shapes and graphics

none

none

Causes lines to graduate in color from the pencolor value to the fillcolor value. nogradient disables it. See gradientp

cs gradient randpc randfc repeat 36 [fd 100 rt 170]


gradientp

boolean

none

boolean

Returns true if gradient is enabled

show gradientp


greaterequalp

boolean

expression | expression

boolean

Returns true if the first expression is greater than or equal to the second expression.

show greaterequalp 5 3
TRUE

show greaterequalp 3 3
TRUE


greaterp

boolean

expression | expression

boolean

Returns true if the first expression is greater than the second expression.

show greaterp 5 3
TRUE

show greaterp 3 5
FALSE


halt

control

worker (number) or workers (list)

none

Halts the specified worker or workers. The worker(s) must be owned by the turtle calling halt.

halt 7
halt [7 9]


hardspace

words and lists

none

“hard space”

Returns a “hard space”, the space that exists at ascii code 160 as opposed to 32 (the standard space). This is needed if you want to use a space in a list or anywhere else the Logo parser might resolve a normal space to nothing.

show hardspace


hatch

turtles

list

none

Hatch clones the selected turtle and then executes the requests specified in the provided list in a new thread. It is automatically given an incremental name based on the name of the turtle that called hatch. A hatchlings HOME is its position when it is hatched. Once all the given requests have been executed the hatchling dies and its turtle track is deleted. If you wish to save its turtle track, you will need to use merge. See merge

hatch [right random 360 forward 100]


hatchlimit

turtles

none

number

Returns the current hatch limit of the calling turtle. See sethatchlimit, hatch

show hatchlimit


hatchlingname

turtles

workerid (number)

turtlename (word)

Returns the name of the hatchling controlled by the given worker IF that worker was created with a hatchling.

show hatchlingname 17


hatchlingp

boolean

turtlename (word)

boolean

Returns true if the given turtlename is a hatchling.

show hatchlingp "seymour
FALSE


hatchlings

turtles

none

none

Returns a list of hatchlings belonging to the selected turtle.

show myrtle:hatchlings


hatchlingworker

turtles

turtlename (word)

workerid (number)

Returns the id number of the worker created with the specified hatchling, if the name supplied is that of a hatchling.

show hatchlingworker "hatchling123
12


heading hd

movement and vectors

none

degrees

Returns the heading (x-axis) of the selected turtle in degrees. Heading is an accumulated, relative value that cannot be used in isolation to accurately reproduce an orientation when the turtle moves in three dimensions – for that, use orientation / setorientation. See pitch and roll

print heading


help

environment

primitivename (word)

none

displays the help entry for the provided primitive name. See viewhelp

help "forward


hideall

turtles

none

none

Hides all turtles. See showall

hideall


hideanchor

environment

none

none

Hides the turtle’s anchor from view. See showanchor, anchor

hideanchor


hidearrow

hidecursor

text

none

none

Hides the text cursor.

hidecursor


hidedirection

hidemouse

environment

none

none

Hides the mouse cursor. See showmouse

hidemouse


hideoverlay

shapes and graphics

name (word)

none

Hides the specified overlay. See newoverlay

hideoverlay "myrtlesview


hideplot

shapes and graphics

plotname (word)

none

Hides (all) the named plot(s). If you want to show / hide one specific instance of a placed plot (since you can place multiple), place them inside of a tag. See tag, showplot, plot

hideplot "myplot


hidesticker

shapes and graphics

name (word)

none

Hides the sticker specified by the provided name parameter. See placesticker

hidesticker "marquee


hidetag

shapes and graphics

tagname (word)

none

Hides the specified tag from displaying. Be aware that this can alter the display of the rest of the turtle track, as the position of the turtle may be altered by the absence of the tag contents from rendering! To solve this problem, call ‘setposition position’ after calling ‘endtag’ when closing a tag. Then, when you hide the tag, the turtle will still end up in the place it lands when the tag is visible, and the remainder of the turtle track rendering will not be disrupted.

hidetag "mytag


hidetrack

shapes and graphics

none

none

Hides the calling turtle’s ‘turtle track’ or visible output. Make it visible again with showtrack.

hidetrack


hideturtle ht

turtles

none

none

Hides the turtle’s model. Show it again with showturtle

hideturtle


historycount

environment

none

number

Returns the number of items in the interactive history.

show historycount


historyitem

environment

number

list

Returns the number-last interactive line entered, where 1 is the latest. Note that if you do ‘show historyitem 1’ from the interactive prompt, you will get ‘show historyitem 1’ as a result!

show historyitem 5


historylist

environment

number

list

Returns the last number lines in the interactive prompt’s history in reverse chronological order, where the first item is the last line entered. Note that if you do ‘show historylist 5’ from the interactive prompt, the first item will be ‘show historylist 5’. Also note that duplicate entries are removed automatically by the interactive prompt’s history code and will not be visible in historylist

show historylist 5


home

movement and vectors

none

none

Returns the currently selected turtle to the home position.

home


hours

environment

none

number

Returns the current hour in 24 hour time.

print hours


icosphere ico

shapes and graphics

radius (number)

none

Creates an icosphere of a specified radius. See icosphereoid

icosphere 10


icospheroid icd

shapes and graphics

radius (number) | multiplier (number)

none

Creates an icosphereoid of a specified radius, stretched using the provided multiplier.

icosphereoid 10 2


if

conditionals and flow

expression | list

none

if can act both as an advisor (function) or a performer (command). If acting as a thinker and the provided expression resolves true, if returns the provided list. If acting as a doer and the provided expression resolves true, if executes the instructions in the provided list.

if 4 = 4 [forward 20]

show if 4 = 4 ["duck]


ifelse

conditionals and flow

expression | list | list

none

ifelse can act as both an advisor or a performer. If the provided expression resolves true, ifelse (advisor) returns the first list, otherwise it returns the second list. If ifelse is acting as a performer, it executes either the first list or the second. See if, else

ifelse :container = 5 [do this] [do that]

show ifelse :container = 5 ["this] ["that]


iffalse iff

iftrue ift

ignore

environment

input

none

Consumes whatever is fed to it. Useful to pull things off of stacks but you don’t need them, such as message queues (listen) or containers (pop).

ignore listen


imagep

boolean

imagename (word)

boolean

Returns true if the specified imagename is defined.

show imagep "image


images

shapes and graphics

none

list

Returns a list of the currently defined images.

show images


import

input and output

file (word)

none

Imports (copies) the specified file into the current turtleSpace. Root / is the current user folder.

import "/myfile


in

containers

anything

anything

in simply passes whatever is passed to it. It is useful in two main contexts: first, to improve the readability of the make alternative put, as in put 5 in “container; second, to retrieve the value of another turtle’s container using query, as in query “myrtle [in :container].

pr query speedy [in :suspensions]


inc

containers

name (word)

none

Increments the contents of the named container by one. Has no effect if the value of the container is not a number.

show "container
4
inc "container
show "container
5


index

words and lists

list

list

Returns a list of numbers indicating the order of provided list items were they to be ordered using the ORDER primitive.

show index [pig dog cow duck]
[3 2 4 1]


initialize

environment

none

none

Re-initializes the turtleSpaces environment. Clears the workspace and resets all the turtle states. Similar to restart.

initialize


input

input and output

word | number

none

Allows the user to enter a word or number which is stored in a container with the name of the first parameter, and whose length is limited by the number provided in the second parameter. For example, ‘input “name 10’ will wait for the user to enter their name, but it can be at most ten characters in length.

input "name 10
melody
print :name
melody


inscribe

shapes and graphics

word, number or list

none

Renders text shapes alongside and to the front of the turtle rather than to the side (as with typeset) using the same size and color as typeset. Unlike typeset, the turtle does not move. See typeset.

repeat 8 [inscribe se char 32 repcount right 45]


insert

place (number) | word or list | item

word or list

Returns the specified word or list with the specified item inserted at the specified place. Compare with replace

show insert 3 [1 2 3 4 5] 6

[1 2 6 3 4 5]

show insert 4 "piggy "f
pigfgy

show insert 1 [cat dog] "mouse
[mouse cat dog]


inside

movement and vectors

[[x1 y1 z1] [x2 y2 z2]]

list

Returns a list of turtles inside the area denoted by the provided sets of co-ordinates.

show inside [[-100 -100 -100] [100 100 100]
[myrtle]


insidep

boolean

[x y z] [[x1 y1 z1] [x2 y2 z2]]

boolean

Returns true if the first set of three-dimensional co-ordinates is within the cube created between the second and third sets of coordinates.

show insidep [0 0 0] [[-10 -10 -10] [10 10 10]]
true


instances

words and lists

number or word | number, list or word

number

Returns the number of instances of the first parameter in the second parameter.

print instances 3 [1 2 3 3 4 5]
2

print instances "l "volleyball
4

pr instances 5 123552
2


integer int

mathematics

number

number

Returns the integer value (rounded down) of the provided number.

show integer 23.34
23


interrupt

control

turtle (word) | instructions (list)

none

Stops all workers executing in the specified turtle, and creates another to preform the specified instructions. The interrupted execution does not resume after the instructions have been executed. Similar to arrest “turtle ask “turtle [instructions]

interrupt "snappy [orbitleft 90]


intquotient

mathematics

number1 (number) | number2 (number)

number

Returns the integer of the quotient (division) of the two provided input numbers. See quotient, remainder

show intquotient 22 7
3


inverse

text

none

none

Causes subsequent text to be displayed in inverse (foreground color as background color and vice-versa).

inverse


iso

shapes and graphics

width height

none

Draws an isosceles triangle of the specified width and height, with the turtle positioned at the center of the lower side, and the triangle pointing in line with the turtle’s current orientation.

repeat 18 [iso 20 60 rollright 10]


item it

words and lists

index list

Returns the individual list item indicated by the index number as a word or number.

show item 4 [dog cow pig frog]

frog

show item 2 [10 20 30]
20


iterate

words and lists

list expression

list

Iterate is a functional version of foreach. It takes a list to be processed, and an expression to evaluate. In the expression, the item to be processed is represented by :item

print iterate [3 5 6] [:item * 3]
9 15 18


jump

movement and vectors

steps (number)

none

Moves the turtle forward the given number of turtle steps without drawing, regardless of the pen state.

jump 20


justify

text

none

word

Returns left, right, center or none, dependent on the current setting.

show justify
left


keyclick

environment

none

none

Causes keypresses to make various beeping noises. See nokeyclick

keyclick


keyclickp

boolean

none

boolean

Returns true if keyclick is enabled. See keyclick

show keyclickp


keyp

boolean

none

boolean

Returns true if there are currently any keys in the keyboard buffer. Often seen with readchar, which will wait for a keypress if there are no keys in the buffer, to mitigate that behaviour. See readchar

show keyp


keys

input and output

word

none

Places the given list of characters into the keyboard buffer.

keys "abcde


label

conditionals and flow

name (word)

none

Creates a ‘label’ with the specified name, which can be ‘jumped’ back to during execution using go. See go

label "start
go "start


largest

words and lists

list

number

Returns the index of the first largest list item.

show largest [10 100 1000]
3


last

words and lists

word or list

word

Returns the last letter (if input is word) or word (if input is list) in the provided input.

print last "frog
g

print last [frog pig duck]
duck


lastrem

environment

none

word or list

Returns the last (executed) ‘remark’ made using rem. See rem

show lastrem


lat

shapes and graphics

size

none

Creates a left-facing right-angle triangle. See rat

lat 20


leading

words and lists

number | word or list

word or list

Returns the specified number of leading items (characters or list items) in the provided word or list. See trailing

print leading 4 "teleporter
tele

show leading 2 [dog cat pig frog]
[dog cat]


left lt

movement and vectors

degrees

none

Turns the selected turtle to the left the specified number of degrees. See right

left 90
lt 45


leftarc larc

movement and vectors

degrees | radius

none

Creates an arc forward and to the left from the turtle’s position, placing the turtle at its end. See rightarc

leftarc 90 40


leftbracket

words and lists

none

[

Returns a left square bracket. Useful for times when turtleSpaces won’t allow you to use an actual left bracket. See rightbracket

print "[
MISSING ]

print leftbracket
[


leftjustify

text

none

none

Left justifies any text output using print. This is the default behavior. If you want to use multiple spaces in print output, you need to disable justify with nojustify

leftjustify


lessequalp

boolean

expression | expression

boolean

Returns true if the first expression is less than or equal to the second expression.

show lessequalp 3 5
TRUE

show lessequalp 3 3
TRUE


lessp

boolean

expression | expression

boolean

Returns true if the first expression is less than the second expression.

show lessp 3 5
TRUE

show lessp 5 3
FALSE


libby

turtles

none

“libby

Libby is the library turtle. She stores procedures to be used by any other turtle. She does not execute procedures herself. The libby primitive simply returns “libby, to avoid having to put the ” on the front of her name when addressing her. See myrtle, snappy

setturtle libby


light

turtles

none

number

Returns the light status of the calling turtle, either 0 (not a light), 1 (spot light) or 2 (point light). See setlight

show light


lightlines

shapes and graphics

none

none

Enables lighting for lines. Normally off by default. As lines have no ‘side’, their ‘normal’ (the direction in which light is reflected) needs to be manually set using setlinesnormal. nolightlines disables it.

lightlines


line

shapes and graphics

length (number)

none

Creates a line of the specified length in front of the calling turtle, without moving that turtle.

repeat 36 [if oddp repcount [line 20] else [line 40] rt 10]


list

words and lists

word | word

list

Takes two words and returns a list. You can use more or less than two words if you surround the entire list primitive with round brackets, as in the example.

show list "frog "pig
[frog pig]

show (list "frog "pig "duck)
[frog pig duck]


listcolors

shapes and graphics

none

none

Prints out the 64 (0-63) color indexes and their associated RGB values. See colors, showcolors

listcolors


listen

turtles

none

message (list)

Returns the message on the top of the messsage queue, which is a list containing two items: the name of the turtle that sent the message, and the message itself (which can be a number, word or list). If there are no messages in the queue, listen will block until there is a message to retrieve.

show listen


listenp

turtles

none

boolean

Returns true if there is a message waiting for the calling turtle. See listen, tell

show listenp


listfiles

input and output

none

none

Lists the files and folders in the current working directory

listfiles


listimages

listmodels

listnames

listoverlays

shapes and graphics

none

none

Prints a list of the currently defined overlays.

listoverlays


listp

boolean

item

boolean

Returns true if the provided item is a list.

show listp [frog pig]
TRUE


listplots

shapes and graphics

none

none

Prints a list of the currently defined plots.

listplots


listprimitives

environment

none

none

Prints a list of all built-in primitives.

listprimitives


listprocs

environment

none

none

Prints the names of the procedures currently belonging to the calling turtle. Similar to show procs

listprocs


listshares

listsounds

listspaces

liststickers

listtables

listtags

listturtles

listworkers

control

none

none

Displays a list of operating workers.

listworkers


listzones

environment

none

none

Prints out the currently defined zones in the Space occupied by the calling turtle.

listzones


ln

mathematics

number

number

Returns the natural logarithm of the given input

show ln 100


load

input and output

projectname (word)

none

Loads the specified project from disk. If that project has a procedure called .autostart defined in the Myrtle turtle, that procedure is executed upon load.

load "myproject


loaddatabase

input and output

filename (word)

none

Loads a database into memory. See savedatabase, newdatabase

loaddatabase "mydb


loaddictionary

input and output

filename | dictionaryname

none

Loads the given dictionary from the filename into the dictionary with the given dictionaryname. See dictionary, newdictionary

loaddictionary "dictfile "mydict


loadimage

input and output

imagename (word) | imagefile (word) OR imageurl (url)

none

Loads the specified image from disk or URL into memory. PNG is the only supported image type.

loadimage "myimage "imagefile.png


loadmodel

input and output

modelname (word) | modelfile (word)

none

Loads the specified model file into the specified model name, replacing it if it already exists or creating it if necessary.

loadmodel "mymodel "modelfile.mdl


loadmusic

input and output

musicname (word) | musicfile (word)

none

Loads the specified music file into memory.

loadmusic "mymusic "music.sng


loadplot

input and output

filename (word) | plotname (word)

Loads the specified plot file into the specified plot name. The plot does not need to have been previously defined. See plot

loadplot “myplotfile “myplot


loadtable

tables

tablename (word) | filename (word)

none

Loads the specified filename from disk into the specified table.

loadtable "mytable "mytable.tbl


loadtag

shapes and graphics

tagname (word) | tagfile (word)

none

Loads the contents of the specified file into the specified tagname. loadtag creates a new tag at the end of the turtletrack if the tagname does not already exist. See savetag

loadtag "mytag "tagfile


loadtrack

shapes and graphics

filename (word)

none

Loads the saved turtle track, replacing the current turtle track. See savetrack

loadtrack "turtletrack


loadsound

sound and music

soundname (word) | filename (word) or URL (word)

none

Loads the given sound filename or URL into the given sound definition. turtleSpaces uses the ‘ogg’ file format. See playsound

loadsound "honk "honk.ogg


local

containers

word or list

none

Changes the scope of the container(s) specified by the supplied word or list to local – that is, they are only accessible by the current procedure, and only while it is executing. To preserve the state of the container when the procedure is not executing, use private. See make

local "container
local [container1 container2]


location

movement and vectors

co-ordinates (list)

list

Returns a list of isRight, isAbove, isAhead where a value of 1 indicates the target co-ordinates are in those areas relative to the turtle’s forward view, 0 indicates that the co-ordinates are on the same plane as the calling turtle as appropriate, and -1 indicates the co-ordinates are in the opposite region (eg a -1 for isRight indicates it is to the left of the turtle’s forward vector / view).

snappy:show location myrtle:position
[0 0 1]

myrtle:show location snappy:position
[0 1 0]


log

mathematics

number

number

Returns the log of the given number.

show log 5
0.698970004336


longest

words and lists

list

number

Returns the item number of the first longest item in the list by number of characters or digits. See count

print longest [pig duck cow]
2

print longest [1000 100 10]
1


longword

words and lists

word, long word or list | word, long word or list

longword

Longword allows you to create a long word from two (or more, if enclosed in parentheses) other long words, words, or lists.

make "longword longword "frog "duck

make "newword (longword "frog "duck [1 2 3])
print :newword
frog duck 1 2 3


longwordp

boolean

word, longword or list

boolean

Returns true if the provided input is a long word (a word that contains spaces).

show longwordp |I am a duck|


lookup

containers

dictionary (name) | key (name)

value(s)

Returns the values associated with the specified key within the specified dictionary. See enter, newdictionary, erasedictionary, cleardictionary, dictionary, dictionaryp, copydictionary, savedictionary, loaddictionary

show lookup "mydict "ducks


loopcount

conditionals and flow

none

number

Returns the current repetition of a forever, while, until, dowhile, dountil or foreach loop. See repcount

forever [show loopcount]


loopsound

sound and music

word

none

Repeatedly plays the sound indicated by the provided word. Stop it with stopsound. See stopsound

loopsound "sheep


lower lo

movement and vectors

turtle-units

none

‘Lowers’ the turtle (moves back along its up vector). Same as doing ‘down 90 forward turtle-units up 90’. For example, Myrtle in her home position when turtleSpaces is started will move away from the Snappy camera turtle if you lower her. See raise

lower 100


lowercase

words and lists

word

word

Returns a lowercased version of the provided word.

show lowercase "FrOg
frog

show iterate [DUCK PIG FROG] [lowercase :item]
[duck pig frog]


lput

words and lists

word or number | list

list

Adds the provided word or number to the provided list. See fput

show lput 40 [10 20 30]
[10 20 30 40]

show lput "pig [dog cow duck]
[dog cow duck pig]


make

containers

name (word) | word, list, evaluated-list, expression or number

names (list) | list of words, numbers or lists

none

Make creates a container (also known as a container) with the name specified by the first parameter, containing the item(s) specified or generated by the second parameter. It also works with lists of both the former and the latter (see examples), but if you want to assign the returns from advisers you will need to use a softlist {}. See name and put

make "container 5
print container
5

make "container [dog pig cow]
show "container
[dog pig cow]

make [ducks frogs pigs] [4 3 1]
show :ducks
4
show :frogs
3

make [x y z] {xpos ypos zpos}


make!

containers

name (word) | expression

Contains a runtime-evaluated expression, or ‘mutated’ container. This allow expressions to be stored inside containers, and rather than being evaluated when stored, they are evaluated when recalled. A container that contains a REX may only contain a single REX and nothing else. See also name! and put!

make! “moo iterate (array 1 + random 10) [“moo]

pr :moo

make! "clock (se hours minutes seconds)
pr :clock


map

words and lists

primitive (word) or list | list

list

MAP outputs a word or list, depending on the type of the data input, of the same length as that data input.(If more than one data input are given, the output is of the same type as data1.) Each member of the output is the result of evaluating the template list, filling the slots with the corresponding member(s) of the data input(s). (All data inputs must be the same length.) In the case of a word output, the results of the template evaluation must be words, and they are concatenated with WORD. if first parameter is “primitive, map passes iterations to the specified primitive and returns the results in a list. See examples

show map [? * ?] [2 3 4 5]
[4 9 16 25]

show map [(word ?1 ?2 ?1)] [[a b c] [d e f]]
[ada beb cfc]

show map "word [[a b c] [d e f]]
[ad be cf]


mapse

words and lists

template (list) | input (list)

result (list)

outputs a list formed by evaluating the template list repeatedly and concatenating the results using SENTENCE. That is, the members of the output are the members of the results of the evaluations. The output list might, therefore, be of a different length from that of the data input(s). (If the result of an evaluation is the empty list, it contributes nothing to the final output.) The data inputs may be words or lists.

In a template, the symbol ?REST represents the portion of the data input to the right of the member currently being used as the ? slot-filler. That is, if the data input is [A B C D E] and the template is being evaluated with ? replaced by B, then ?REST would be replaced by [C D E]. If multiple parallel slots are used, then (?REST 1) goes with ?1, etc.

In a template, the symbol # represents the position in the data input of the member currently being used as the ? slot-filler. That is, if the data input is [A B C D E] and the template is being evaluated with ? replaced by B, then # would be replaced by 2.

make "numbers [zero one two three four five six seven eight nine]
show mapse [item ?+1 :numbers] 5789
[five seven eight nine]

show mapse [sentence (word "With ?) "You] [in out]
[Within You Without You]

show mapse [sentence ? "Warner] [Yakko Wakko Dot]
[Yakko Warner Wakko Warner Dot Warner]


marco

control

turtle (word)

none

Marco causes the calling turtle to wait until the specified turtle calls polo. This allows for some simple synchronisation between turtles. See marcop, marcos, polo

marco "snappy


marcop

boolean

none

boolean

Returns true if the calling turtle has any current marcos attributed to it. If a turtle is expecting a marco, it can simply wait until marcop is true. See marco

show marcop


marcos

control

none

list

Returns a list of all the turtles that have called marco on the calling turtle. See marco

show marcos


mark

shapes and graphics

turtle-units (number)

none

Mark moves the turtle forward the specified turtle units, drawing a quad using the ‘marker’ rather than the pen. You can set the diameter of the ‘mark’ using setmarkerwidth

mark 10


markerwidth

turtles

none

turtle-units (number)

Returns the width of the current marker in turtle-units.

show markerwidth
2


match

words and lists

search pattern (word) | list

number

Returns the item number of the first matching search result instead of the result itself. See search

print match "*g [cat duck frog]
3


matches

words and lists

search pattern (word) | list

list

Returns a list of the item number(s) matching the search word instead of the results themselves. See search

print matches "*g [pig duck cat frog]
[1 4]

###

matchp

boolean

search pattern (word) | list

boolean

Returns true if doing a search of the provided list using the provided search word would return a result.

show matchp 10 [10 20 30]
true


max

mathematics

number | number

number

Returns the greater of the two provided numbers. See min

show max 4 6
6


maximize

environment

none

none

Maximizes (makes full-screen) the turtleSpaces window. See restore (which restores it)

maximize


member

words and lists

word or list

word or list

Member returns the part of the second parameter in which the first parameter is the first element.

show member "duck [pig duck frog]
[duck frog]

show member "du "pigduck
"duck


memberp

boolean

word or list

word or list

Returns true if the result of calling member using similar parameters is not empty.

show memberp "duck [pig duck frog]
true


merge

shapes and graphics

none

none

Causes the turtle track of a hatchling to merge with its parent at the start of the parents turtle track. The hatchling’s turtle track is empty after the merge. See hatch

merge


mimic

turtles

target (word)

none

locks the calling turtle’s orientation to that of the target turtle. nomimic turns it off

mimic "snappy


mimicking

turtles

none

turtle (word)

Returns the name of the turtle the calling turtle is mimicking, if any.

show mimicking


mimicp

boolean

none

boolean

Returns true if the calling turtle is mimicking another turtle. See mimic

show mimicp


min

mathematics

number | number

number

Returns the lesser of the two provided numbers. See max

show min 4 5
4


minutes

environment

none

number

Returns the current minutes value of the computer’s sytem clock

print minutes
10


model

environment

none

word

Returns the name of the currently selected model.

print model
myrtle


modelhome

movement and vectors

none

none

modelhome sets the turtle to the position and vectors set by setmodelorigin. These two primitives are only useful inside of model definitions, they are relative to the position and vectors of the turtle prior to the drawing of the model (its absolute vectors and position). See setmodelorigin, newmodel

modelhome

###

modelp

environment

word

boolean

Returns true if there is a model with the name of the provided word.

show modelp "turtle
true


mod

mathematics

numerator (number) | denominator (number)

Returns the floating-point remainder of the division of the supplied numerator by the denominator, as opposed the remainder primitive, which takes and returns integer (whole) values. See remainder

show mod 22 6.5

2.5


models

turtles

none

list

Returns a list of the currently defined models.

show models
[myrtle turtle]


modelscale

shapes and graphics

none

scale (number)

Returns the calling turtle’s current modelscale value. Default is 1. See setmodelscale

show modelscale


month

environment

none

month (number)

Returns the current month.

show month
8


move

movement and vectors

vector (list) | distance (number)

none

Moves the turtle the specified distance in turtle units in the direction of the given vector, allowing for arbitrary movement. If the pen is down, the turtle draws a line.

move forwarddir 20


movefile

input and output

sourcefile (word) | destinationfile (word)

none

Moves the specified file to the specified destination.

movefile "myfile "newfile


mousebutton

input and output

none

number

Returns 0, 1 (left button), 2 (right button) or 3 (both buttons). See buttonp

show mousebutton


mouseclick

input and output

screenposition (list) | clicktype (number)

none

Simulates a mouse click. The provided screen position should be in terms of percentages of the width and height of the screen, with 0 being the left and top respectively. The second parameter is one of the following: 1 – left click, 2 – right click, 3 – both / middle click. This is useful for tutorials or test workers

mouseclick [50 50] 1


mousex

input and output

none

percentage (number)

Returns the current horizontal mouse position in terms of the percentage of the screen width, with 0 being the left edge.

show mousex


mousey

input and output

none

percentage (number)

Returns the current vertical mouse position in terms of the percentage of the screen height, with 0 being the top edge.

show mousey


musicp

boolean

musicname (word)

boolean

Returns true if the specified music name is loaded in memory.

show musicp "mymusic


musicspeed

sound and music

none

number

Returns the current music speed.

show musicspeed


musicvolume

sound and music

none

number

Returns the calling turtle’s music volume.

show musicvolume


myworker

control

none

id (number)

Returns the worker ID of the worker that calls it. See myworkers

show myworker


myworkers

control

none

list

Returns a list of the IDs of the workers belonging to the calling turtle or its hatchlings. Hatchlings do not own workers, only ‘root’ turtles. myworkers doesn’t return any results if called by a hatchling. See newworker, workers

show myworkers


myrtle

turtles

none

“myrtle

Myrtle is the turtle you see when you start up turtleSpaces, and she is the first turtle selected. Her name simply returns “myrtle, so a quote is unneeded when you invoke setturtle myrtle. See snappy, libby

setturtle myrtle


name

containers

number, word, longword, list, expression or container | name (word)

none

An alternative to make. Traditionally used for constants, eg name 3.14 “pi. See make, put

name 3.14 "pi


name!

containers

expression | name (word)

none

Creates a mutated container, one whose expression is re-evaluated whenever it is accessed. See make!

name! (se hours minutes seconds) "clock


namep

boolean

container (word)

boolean

Returns true if the specified container exists.

show namep "container


names

containers

none

list

Returns a list of the defined containers (their names).

show names


nameturtle

turtles

name (word)

none

Creates a new turtle, but unlike newturtle does not switch to it on creation.

nameturtle "fred


near

movement and vectors

position (list) | radius (number)

list

Returns a list of all the turtles within the specified radius of turtle-units from the specified position. See nearme

show near [0 0 0] 10


nearme

movement and vectors

distance (number)

turtles (list)

Returns a list of turtles within the specified distance of the calling turtle, except the calling turtle itself. See near, nearp

show nearme 200


nearp

boolean

distance

boolean

Returns true if there are any (nostealth) turtles in the given distance from the calling turtle.

show nearp 200
TRUE


negative

mathematics

number

number

Returns the negative of the provided number. You can also negate containers or advisor returns by prefixing them with -, eg -:container or -advisor. See abs

show negative 10
-10

show negative -20
20


newdatabase newdb

containers

name (word)

none

Creates a new database. Databases store keys and containers. For more information, see store, retrieve. See also savedatabase, loaddatabase

newdatabase "animals


newdictionary

containers

name (word)

none

Creates a special type of container called a dictionary. Dictionaries contain a list of ‘name value pairs’ – a series of containers. See enter, lookup, erasedictionary, cleardictionary, dictionary, dictionaryp, copydictionary, savedictionary, loaddictionary

newdictionary "mydict


newmodel

shapes and graphics

name (word) | tagname (word) or [command list] (list)

none

Creates a new model, using either the contents of the specified tag, or the provided list of turtle commands. See setmodel

newmodel "sphere [icosphere 20]
newmodel "fromtag "tag


newoverlay

shapes and graphics

name (word) | turtle (word)

none

Creates a new camera ‘overlay’ or picture-in-picture with the specified name using the point of view of the specified turtle. You position the overlay on the screen using placeoverlay

newoverlay "myrtlesview "myrtle


newplot

shapes and graphics

name (word) | dimensions (list)

Defines a new plot (a grid of pixels or voxels) with the provided name, and of the provided dimensions. If the list has two numbers, a two-dimensional plot is created. If the list has three numbers, a three-dimensional plot is created. See placeplot

newplot “myplot [10 20]

newplot "myplot [5 5 5]


newspace

environment

name (word)

none

Creates a new space with the specified name.

newspace "myspace


newsticker

shapes and graphics

name (word) | image (word)

none

Defines a new sticker using the provided image. See placesticker

loadimage "marqueeimage "marquee.png
newsticker "marqueesticker "marqueeimage


newtable

tables

name “word | [rows columns (sheets)] (list)

none

Creates a new table of the provided dimensions. Note that the dimensions are provided as a list of two (or three) numbers. If a number of sheets (third number) is provided, a third sheet number must also be provided in cell and setcell, and setsheet must be used to specify the sheet number for the srow, scol, replacerow, replacecolumn, row and column primitives. See setcell

newtable "mytable [3 20]


newturtle newtu

turtles

name (word)

none

Creates a new turtle with the given name.

newturtle "daisy


newworker

control

list

none

creates a new ‘worker’ and executes the contents of the list of primitives or procedures provided to it.

newworker [forever [rt random 180 fd random 100]]


newworkerid

control

list

number

newworkerid creates a new worker the same as newworker, but acts as a function and returns the thread ID of the new worker.

show newworkerid [forever [rt random 180 fd random 100]]


newzone

environment

name (word) | [x y z] (list) | [x y z] (list)

none

Creates a voxeloid ‘zone’, an invisible area of ‘sectors’ in turtleSpace that contain name / value pairs (keys) unique to those sectors. The first list provided to newzone specifies the number of sectors in the x direction, y direction and z direction, the second list specifies the size of those sectors in x, y and z. The zone is created to the up, right and under the turtle relative to its position BUT NOT its orientation, so in the positive x, positive y but negative z from the turtle’s position.

newzone "zone [50 50 50] [5 5 5]


nextframe

shapes and graphics

none

none

Waits until the next frame of video is rendered. Useful for creating smooth animations in combination with norender and render (eg render nextframe norender) by otherwise disabling rendering except for one nextframe per loop. Warning: If norender is currently set, nextframe will wait indefinitely!

render nextframe norender


noapi

environment

none

none

Disables incoming API connectivity. See api

noapi


noaudiowait

sound and music

none

none

Causes the calling turtle not to wait while TOOT and NOISE are played.

noaudiowait


noattenuate

sound and music

none

none

Disables audio attenuation for the calling turtle. See attenuate

noattenuate


noblocks

environment

none

none

Disables blocks mode

noblocks


nocamcontrol

environment

none

none

Disables ‘camcontrol’ mode

nocamcontrol


nocaseinsensitive

words and lists

none

none

Makes search, sort and comparisons case sensitive. See caseinsensitive

nocaseinsensitive


nodebug

environment

none

none

Disables debug. See debug

nodebug


nodes

environment

none

7179

nodes returns 7179, the blocks of memory free at a ‘cold start’ of Apple Logo on an Apple IIe 128K computer. It exists here only for compatibility.

show nodes
7179


nodragselect

environment

none

none

Disables dragselect. See dragselect

nodragselect


nodribble

input and output

none

none

Ends a current dribble, if any. See dribble

nodribble


noescape

control

none

none

Disables the ability of the escape key to halt all execution. See escape

noescape


nofluid

turtles

mone

none

Disables fluid mode on the calling turtle.

nofluid


nofollow nfo

turtles

none

none

Disables follow mode in the calling turtle.

nofollow


noise

sound and music

frequency (number) | duration (number)

none

Generates noise output of the specified frequency, and duration in 60ths of a second. See toot

noise 2000 100


nojustify

text

none

none

Disables justify (and word wrapping)

nojustify


nokeyclick

environment

none

none

Disables keyclick if enabled. See keyclick

nokeyclick


nolightlines

shapes and graphics

none

none

Disables line lighting. See lightlines

nolightlines


noosd

environment

none

none

Disables the on-screen display. See osd

noosd


nopaging

environment

none

none

Disables paging. See paging

nopaging


nopaper

environment

none

none

Disables paper. See paper

nopaper


norender

shapes and graphics

none

none

Disables the renderer. There will be no updates to the graphical output while norender is enabled. This includes view turtle (camera) movement! Pressing the escape key will re-enable render, as will the render primitive. See render

norender


normal

text

none

none

Causes subsequent text to be displayed normally, eg without inverse or flash. See inverse, flash

normal


nosandbox

environment

none

none

Disables sandbox mode. Must be called by another turtle without sandbox restrictions (eg myrtle:nosandbox) or nosandbox must be included in the sandbox declaration. See sandbox for more information.

nosandbox
myrtle:nosandbox


nospeckle

shapes and graphics

none

none

Disables speckling of voxels and quads. See speckle

nospeckle


nostealth

movement and vectors

none

none

Causes calling turtle to appear in lists generated by near. See stealth

nostealth


nostep

environment

none

none

Cancels all steps. See step

nostep


nosync

control

none

none

Cancels a current sync. See sync

nosync


not

boolean

boolean

boolean

Reverses an input boolean, an expression that resolves to either true or false

print not 5 = 4
TRUE


noteschannel

sound and music

none

number

Returns the current channel used to play notes by the playnotes primitive. See setnoteschannel

show noteschannel


notesp

boolean

none

boolean

Returns true if the playnotes primitive is currently playing.

show notesp


notespeed

sound and music

none

number

Returns the current speed of playnotes playback.

show notespeed


notether

movement and vectors

none

none

Untethers the selected turtle from the orbit anchor point. When the turtle is untethered, the anchor point moves relative to it.

notether


notrace

environment

none

none

Cancels all traces. See trace

notrace


notrack

shapes and graphics

none

none

Causes the calling turtle not to generate a track and erases any existing track without changing the turtle’s position, after which any shape and graphics primitives are ignored. See track

notrack


notrackrender

shapes and graphics

none

none

Stops the calling turtle’s ‘track’ render from updating. Its current buffered render will continue to be displayed. This is handy for complex scene creation – you can choose to reveal parts of the scene as they are created. See trackrender, hidetrack, showtrack, render, norender

notrackrender


notranscript

environment

none

none

Disables transcript, if enabled. See transcript

notranscript


number

words and lists

word

number

Converts a word or list item into a number. Usually turtleSpaces will convert a word into a number automatically if the word is supplied to a numeric function, but there are cases such as comparison operators where you may need to convert the word to a number manually in order to ensure correct evaluation.

print number "20
20


notwosided ntws

shapes and graphics

none

none

Causes the surface of shapes to only be ‘lit’ from one side – in OpenGL parlance, only one side has ‘normals’. This is the default. If you wish both sides of a shape’s surface to be lit, invoke twosided. See twosided

notwosided


nowebtext

environment

none

none

Disables the webtext pane (webLogo only). Usually followed by setwrite ” to restore output to the interactive text area. See webtext, setwrite

nowebtext setwrite "


numbers

words and lists

list

list

Returns a list containing only those elements that are numbers.

show numbers [12 pig 134 cow]
12 134


numberp

boolean

word

boolean

Returns true if the supplied input is a number.

show numberp 15
TRUE

show numberp "dog
FALSE


octahedron oct

shapes and graphics

size (number)

none

Creates a octahedron (8-sided shape) of the specified size.

octahedron 5


octahedroid octo

shapes and graphics

size (number) | ratio (number)

none

Creates a octahedroid (8-sided shape) of the specified size and stretched using the specified ratio.

octahedroid 5 2
octahedroid 10 0.5


oddp

boolean

number

boolean

Returns true if the provided number is odd (1, 3, 5, 7…)

show oddp 6


off

boolean

none

none

Same as FALSE

show off


on

boolean

none

none

Same as TRUE

show on


oncefalse

conditionals and flow

boolean | instructions (list)

none

Preforms the provided list of instructions if the boolean is false once, and not again until the boolean becomes true and then false once more (for example, when the turtle crosses a boundary). To ‘flip’, oncefalse must see the boolean become true (be called when the boolean is true). See oncetrue

oncefalse :boolean [instructions]


oncetrue

conditionals and flow

boolean | instructions (list)

none

Preforms the provided list of instructions if the boolean is true once, and not again until the boolean becomes false and then true once more (for example, when the turtle crosses a boundary). To ‘flip’, oncetrue must see the boolean become false (be called when the boolean is false). See oncefalse

oncetrue :boolean [instructions]


onerror

conditionals and flow

list

none

Causes the calling turtle to execute the supplied list of instructions when an error is encountered rather than stop execution. It then continues execution from the point the error was encountered. onerror is ‘scoped’ to the procedure it is called from.

onerror [print "Caught!] show 1 / 0
Caught!


open

input and output

filename (word)

none

Opens a file for reading or writing. You must also setread / setwrite the file in order to read from / write to it. See close, setread, setwrite

open "myfile


openlink

input and output

link (word)

none

opens the specified URL (weblogo only)

openlink "https://turtlespaces.org


or

conditionals and flow

expression | expression

boolean

Returns true or false based on whether or not one or more of the supplied expressions are true. or takes two expressions by default, but can take more than two if the entire or statement is wrapped in brackets, eg: (or expr1 expr2 expr3 …) See and

show or 1 = 1 2 = 3
TRUE


orbitdistance

movement and vectors

none

turtle-units (number)

Returns the distance between a turtle and its anchor point. See setanchor, dropanchor

show orbitdistance


orbitdown odn

movement and vectors

degrees (number)

none

Orbits down from (beneath) the turtle around its anchor point the specified number of degrees. Note that the turtle goes to its destination directly regardless of the status of fluid, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor

orbitdown 90


orbitleft olt

movement and vectors

degrees (number)

none

Orbits the turtle left around its anchor point the specified number of degrees. Note that the turtle goes to its destination directly regardless of the status of fluid, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor

orbitleft 90


orbitright ort

movement and vectors

degrees (number)

none

Orbits the turtle right around its anchor point the specified number of degrees. Note that the turtle goes to its destination directly regardless of the status of fluid, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor


orbitup oup

movement and vectors

degrees (number)

none

Orbits up from (above) the turtle around its anchor point the specified number of degrees. Note that the turtle goes to its destination directly regardless of the status of fluid, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor

orbitup 90


orbitvector

movement and vectors

vector (list) | degrees (number)

none

Orbits the specified number of degrees around the turtle’s anchor point using the specified vector. To orbit in the opposite direction, specify a negative number of degrees. Note that the turtle goes to its destination directly regardless of the status of fluid, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor

orbitvector updir 10


order

words and lists

word number or list

none

Returns the input in alphabetical and / or numeric order, numbers first.

show order "frog
fgor

show order 54321
12345

show order jq831md
138djmq

show order [pigeon duck goose chicken]
[chicken duck goose pigeon]


orientation

movement and vectors

none

list

Returns the current orientation, in the order specified by orientationorder. So if orientation order is set to “phr, then the first value returned by orientation will be pitch, the second heading and the third roll. See orientationorder

show orientation


orientationorder

movement and vectors

none

word

Returns the current order heading, pitch and roll are processed when setorientation, setheading, setpitch or setroll is used.

show orientationorder
"hpr


origin

movement and vectors

none

list

Returns the current origin co-ordinates. See setorigin, home

show origin
[0 0 0]


originvectors

movement and vectors

none

list

Returns the current origin vectors. See setoriginvectors, origin, home

show originvectors


osd

environment

input

none

Displays the provided input on the ‘on-screen display’, a text overlay layer used to display system messages (typically errors). The message remains until you use noosd to turn it off. See noosd

osd [Game over!]


osdp

boolean

none

boolean

Returns true if the OSD is currently on. See osd

show osdp


otherwise

conditionals and flow

list

none

If no case statement has been satisfied since the last switch, execute the provided list. See switch, case

otherwise [pr |Eat a sandwich.|]


output op

conditionals and flow

input

output

Used by procedures to return output to a calling procedure or function. The input and output are effectively the same.

to duck
output "quack
end

print duck
quack


oval

shapes and graphics

width (number) | height (number)

none

Creates a filled oval of the specified width and height. See ellipse

oval 50 20


overlayp

boolean

name (word)

boolean

Returns true if the specified overlay exists. See newoverlay

show overlayp "overlay


overlays

shapes and graphics

none

list

Returns a list of the currently defined overlays.

show overlays


overlayscreen os

text

none

none

Overlays the full text screen over the graphics output, basically a transparent textscreen. Not to be confused with camera overlays. See textscreen, splitscreen, fullscreen

overlayscreen


pacify

control

none

none

Calms (stops) all turtles except for the turtle who calls pacify. See calm

pacify


paging

environment

none

none

pause and wait for a keypress if text output would push previous text output off of the screen generated since the last page prompt, interactive mode prompt, question, input, readchar or readlist – default is enabled. nopaging turns it off

paging


paddle

input and output

paddle (number)

value (number)

Takes a value from 0 to 3 that indicates the ‘paddle’, which is the axis value of a controller and can be from 0 to 255. Paddles can be controlled either from a joypad (paddle 0 and 1 is usually the horizontal and vertical axes of the left thumbstick respectively, and 2 and 3 the right thumbstick) or using the mouse (paddle 0 and 1 return results based on the mouse’s position on the window.) See buttonp, gameaxis, gamebuttons

show paddle 0


paper

environment

none

none

Enables ‘paper’ (white) mode. nopaper turns it off.


paperp

boolean

none

boolean

Returns true if paper mode is enabled. See paper

show paperp


parse

words and lists

word

list

Outputs a list that is created from parsing the provided word. Useful for converting the output of readword into a list, or converting other ‘long words’ (words with spaces) into their component parts.

show parse |dog cat pig|
[dog cat pig]


path

input and output

none

word

Returns the current file path.

show path


pause

conditionals and flow

none

none

Causes execution in the calling worker to pause and return to the prompt. Execution can be continued with co. Pause only works with the main (archon) worker. NOTE: pause DOES NOT WORK in interactive mode (only in a procedure!) See co

pause


pausemusic

sound and music

none

none

Pauses playback of music, if music is playing. See resumemusic

pausemusic


peak

shapes and graphics

width | height | depth

none

Creates a lined wedge around and beneath the calling turtle. The width distance is the distance to one side of the turtle (the total width of the peak is double the provided width value).

peak 10 20 30


peekchar

input and output

none

character

Returns the current next character in the keyboard buffer, if any. This character is left in the buffer. See readchar, clearchar

show peekchar


pen

pencolor pc

shapes and graphics

none

number

Returns the current pen color.

show pencolor


pendown pd

shapes and graphics

none

none

Puts the calling turtle’s ‘pen’ down (causes it to draw a line when moved).

pendown


penopacity

shapes and graphics

none

number

Returns the calling turtles pen opacity. See setpenopacity

shoe penopacity


penshade psh

shapes and graphics

none

shade (number)

Returns the current pen shade value. See setpenshade

show penshade


penup pu

shapes and graphics

none

none

Lifts the calling turtle’s pen up, it won’t draw a line when it moves. See pendown

penup


pi

mathematics

none

number

Returns 3.141592653589793

show pi
3.141592653589793


pick pk

words and lists

list

item

Returns a random item from the provided list.

show pick [dog cow sheep]
sheep

setbackgroundcolor pick [1 4 5]


pie

shapes and graphics

degrees (number) | radius (number)

none

Creates a pie-chart like object of the specified radius and degrees, starting at the turtle’s right vector and moving counter-clockwise.

pie 270 20


pin

shapes and graphics

none

none

Drops a ‘pin’, for use with pinfrag and pinshard

pin


pinfrag

shapes and graphics

none

none

Creates a ‘frag’ using the last three dropped ‘pins’. See pin, frag

pinfrag


pinshard

shapes and graphics

none

none

Creates a ‘shard’ using the last three dropped ‘pins’. See pin, shard

pinshard


pitch pt

movement and vectors

none

pitch (number)

Returns the pitch (attitude) of the current turtle

print pitch


placeoverlay

shapes and graphics

name (word) | [x1% y1% x2% y2%] (list)

none

Places the named overlay on the screen over the list of co-ordinates which are specified in terms of percentages. See newoverlay

placeoverlay "myrtlesview [0 0 50 50]


placeplot

shapes and graphics

name (word) | voxel / pixel size (list)

none

Places the named plot at the current turtle position using pixels (by providing a list of two) or voxels (by providing a list of three)

placeplot "myplot [10 10]
would place a plot using pixels 10 turtle-units in size, while

placeplot "myplot [5 5 5]
would place a plot using voxels 5 turtle-units in size


placesticker

shapes and graphics

name (word) | [x1% y1% x2% y2%] (list)

none

Places the sticker with the provided name over the area of the screen specified by the provided list, which is in terms of percentages of the screen dimensions, where 100% is the right / bottom and 0% is the left / top. As the name suggests, a sticker is a static image which does not move with the camera view, as if you stuck a sticker to your display. See stickers, stickerp

loadimage "marquee "marquee.png
newsticker "marqueesticker "marquee
placesticker "marqueesticker "marquee [25 25 75 75]


playnotes

sound and music

notes [list]

none

Plays back the provided list of notes. L specifies note length.

playnotes [L3 A3 L2 Bb3 C#3]


playmusic

sound and music

musicname (word)

none

Begins playing the named music. The music needs to have first been loaded into memory using loadmusic

playmusic "mysong


playmusicp

boolean

none

boolean

Returns true if music is currently playing.

show playmusicp


playsound

sound and music

“sound (word)

none

Plays a sound, where “sound can be a loaded sound or a ‘built-in’ one from the list given in the example.

air crack laugh stapler
air2 crash laughter static
air3 crinkle lid step
alarm crow lightbulb step2
alarm2 descent lion switch
alien dice meow switch2
alien2 doh missile tear
alien3 doodoo oof thwap
applause door paddle tiger
arcade drip pew ting
augh drop pingpong ting2
aw dunk plastic tinpan
bark evil plastic2 tires
beep explosion please toaster
beep2 fall pong tuee
beep3 fire pop tweet
beep4 fire2 powerup ufo
bell ghost radio ufo2
bell2 glass ratchet ufo3
blastoff glitch rattle ufo4
blub gong rattle2 ufo5
boing growl rattle3 ufo6
bong gun ringring warning
buc gun2 rocket whip
button gun3 rooster whip2
buzz gurgle saw whoosh
candy ha scanner wind
carkeys hangup scissors wind2
carstart hangup2 sheep window
cellphone hit sheep2 witch
cheers honk sheep3 wood
chomp honk2 slap wrapper
clang interference slide zap
click jingle sneeze zap2
click2 knock soda zap3
click3 laser spin zblrf
close latch spinout zip
cluck latch2 squeak zipper


plist

containers

propertylistname (word)

propertylist (list)

Outputs the property list associated with the supplied name. Any word can have a property list associated with it – a list of ‘properties’ and their values. plist returns a list of these pairs sequentially: [property1 value1 property2 value2 etc.] See pprop

show plist "propertylist


plot

shapes and graphics

coordinates (list)

none

Plots a pixel / voxel at the specified co-ordinates in the currently selected plot. The list may contain two or three numbers depending on if the plot is two- or three-dimensional. See placeplot

plot [10 20]

plot [10 20 10]


plotcol

shapes and graphics

coordinates (list)

number

Returns the color (if any) of the specified pixel / voxel in the currently selected plot. The list of coordinates may contain two or three numbers, depending on if the selected plot is two- or three-dimensional. See plot

show plotcol [10 20]
show plotcol [10 20 10]


plotline

shapes and graphics

start co-ordinates (list) | end co-ordinates (list)

none

Plots a line from and including the first set of provided co-ordinates to and including the second set of provided co-ordinates. The co-ordinates may contain two or three numbers dependent on if the plot has two or three dimensions. See plot

plotline [1 1 1] [5 5 5]


plots

shapes and graphics

none

list

Returns a list of the currently defined plots. See newplot, placeplot, plot

show plots


plottotrack

shapes and graphics

plotname (word) | [x y z] list

instructions (list)

Renders the given plot with the voxel size specified in the given list as a series of instructions that can be passed into setmodel to turn a plot directly into a turtle model (with the turtle’s position being the dead center of the plot). Using plottotrack in isolation will cause the turtle to render the plot. See plot

setmodel “model plottottrack “plot [1 1 1]
plottotrack “plot


po

environment

name or names (word or list)

none

Prints out the specified procedure or procedures to the screen.

po "procedure
po [procedure1 procedure2]


poall

environment

none

none

Prints out the definition of every procedure and the value of every container in the workspace.

poall


pofile

input and output

filename (word)

none

Prints out the specified text file to the screen.

pofile "textfile


polo

control

turtle (word)

none

Calls polo on the specified turtle. See marco, marcop, marcos

polo "myrtle


poly

shapes and graphics

radius (number) | sides (number)

none

Draws a convex polygon of the specified radius and number of sides.

poly 10 6


polyellipse

shapes and graphics

width (number) | height (number) | sides (number)

none

Draws a convex polygon of the specified dimensions and sides.

polyellipse 20 10 10


polyoval

shapes and graphics

width (number) | height (number) | sides (number)

none

Creates a filled convex polygon of the specified dimensions and sides.

polyoval 10 20 5


polyspot ps

shapes and graphics

radius (number) | sides (number)

Creates a filled convex polygon of the specified radius and number of sides.

polyspot 20 5


pon

containers

container(s) (word or list)

none

Prints out the name and value of the named container(s)

pon "container


pons

containers

none

none

Prints out the names and values of every container in the workspace.

pons


pop

containers

container

item

‘Pops’ the item at the front of the container and returns it, removing it from the contained word or list. Equivalent to: make “pop first :list make “list butfirst :list

See push

make "result pop "pushlist


pops

environment

none

none

Prints all of the calling turtle’s procedures to the screen.

pops


popturtle popt

turtles

none

none

‘Pops’ a turtle state off of the stack and restores the turtle to it. See pushturtle

popturtle


pos

movement and vectors

none

[x y] (list)

Returns the x and y co-ordinates of the turtle. For all three dimensions, use position

show pos


position

movement and vectors

none

[x y z] (list)

Returns the co-ordinates of the turtle. For just the first two dimensions, use pos

show position


pot

environment

procedure name or names (word or list)

none

Prints the ‘title(s)’ of the supplied procedure(s) stored in the calling turtle, the ‘to’ declaration that includes the procedure’s parameters.

pot "myprocedure
TO MYPROCEDURE :SIZE :SHAPE


pots

environment

none

none

Prints the titles of every procedure stored in the calling turtle.

pots


power

mathematics

number | number

number

Returns the power of the second number to the first number. Similar to ^.

show power 5 5
125


pprop

containers

name | property | value

none

Property lists are a special type of container that hold multiple property / value pairs. You can have a property list and a non-property list container with the same name.

pprop "addresses [Marty McFly] [9303 Lyon Drive, Lyon Estates, Hill Valley CA 95420]


pps

containers

none

none

Prints the property list containers belonging to the calling turtle.

pps


prefix

input and output

none

path

Returns the ‘prefix’ or current file system path. / is the user’s folder.

show prefix


primitivep

primitives

environment

none

list

Returns a list of all available primitives (also known as primitives).

show primitives


print pr

text

input

none

Prints the input (word, number, list, expression) to the screen. If leftjustify, rightjustify or center is enabled, then print automatically wraps its output. See nojustify to disable wrap.

print "Hello!
print |How are you?|
print [I am fine]
print 5 * 3
print myrtle:position


prism pri

shapes and graphics

width | height | depth

Creates a lined prism to the right, forward and under the turtle.

prism 20 10 30


private

containers

word

none

Initialises a private container with the name provided. A private container is a container which only exists and whose value persists inside of a procedure. This allows you to construct a procedure that modifies and stores internal parameters without losing them when that procedure exits, and needing to store them in the turtle. See the examples.

TO test
if not namep "frog [private "frog make "frog 1 stop]
inc "frog
show :frog
END

TO test :switch
private "var
if :switch = "a [make "var 1]
if :switch = "b [inc "var show :var]
END


procs

turtles

none

list

Returns a list of the calling turtle’s currently defined procedures.

show procs


procp

boolean

name (word)

boolean

Returns true if the calling turtle has a procedure with the provided name.

show procp "procedure


product

mathematics

number1 (number) | number2 (number)

number

Returns the product of (multiplies) its two inputs, similar to the * operator.

show product 4 5
20


pullin pui

movement and vectors

turtle-spaces (number)

none

Pulls the calling turtle toward its anchor point the specified number of turtle-spaces. Stops if it reaches its anchor point.

pullin 40


pullout puo

movement and vectors

turtle-spaces (number)

none

Pulls the calling turtle out away from its anchor point the specified number of turtle-spaces.

dropanchor repeat 20 [penup pullout 10 pendown repeat 36 [orbitleft 10]]


put

containers

input (number, word, longword, list, primitive or container) | in | name (word)

none

Another syntax for make used by some Logos. ‘in’ is a simple prmitive that forwards whatever is passed to it. See in

put 5 in "counter


put!

containers

expression | in | name (word)

See make!

put! (se hours minutes seconds) in “clock


putcell setcell

tables

table (word) | [row column (sheet)] (list) | value

none

Sets the cell in the table with the provided name to the provided value. If no sheet number is provided, setcell will default to sheet 1, if the table has multiple sheets. See cell

setcell "table [4 5] 20
setcell "table3 [4 5 2] 30


putsector setsector

environment

name (word) | value

none

Stores a key (name / value pair) in the current sector. A zone must be selected, and the calling turtle must be inside a sector for putsector to work. See newzone, whichsector, readsector

putsector "duck 123


pyramid py

shapes and graphics

size (number) OR [width height depth] (list)

none

Creates a pyramid (5-sided shape) of the specified size.

pyramid 10
pyramid [5 10 20]


push

containers

item | container

none

“Pushes” the item on to the front of the specified container, making it the first item, and pushing the rest of the items to the right. If the container contains a word, push pushes the item on to the start of the word. If the container contains a list, push pushes the item on to the front of the list. To pull the item out of the container, use pop. Also see queue and dequeue (which do similar but to the end of the container).

push "frog "animals


pushturtle pusht

turtles

none

none

‘Pushes’ the state of the turtle on to a stack (position, pen color, etc.) popturtle pulls the state back off of the stack again. Imagine drawing a tree with randomly extending branches. You can construct it by pushing the turtle’s state at each junction, then popping the turtle to return to it, then the previous one, etc.

pushturtle


pyramoid pyo

shapes and graphics

size (number) | ratio (number)

none

Creates a pyramoid (stretched pyramid) of the specified size and stretch ratio.

pyramoid 10 2


quad qd

shapes and graphics

width | height

Creates a ‘quad’, a two-dimensional filled rectangle of the specified width and height, to the front and right of the turtle.

quad 20 10


queue

containers

item | container

none

Similar to push, except adds the provided item to the end of the container, appending it to the word or list inside it. See push

queue "item "container


query

turtles

turtle (word) | query (list)

result

Allows you to query another turtle’s internal state. See in

show query "snappy [position]


question

input and output

word or list

none

Asks the user the ‘question’ posed in the provided word or list. The answer is retrieved through the answer primitive. See answer

question [What is your name?]


quiet

sound and music

none

none

Stops playback of all sounds from all turtles. This doesn’t mute auto playback in general, only stops the currently playing sounds.

quiet


quotient quo

mathematics

number1 (number) | number2 (number)

number

Returns the first number divided by the second number, similar to using the / operator. See intquotient, remainder

show quotient 22 7
3.142857142857143


radarccos

mathematics

number

number

Outputs the inverse cosine of its input in radians.

show radarccos 0.5
0.87758256189


radarcsin

mathematics

number

number

Outputs the inverse sine of its input in radians.

show radarcsin 0.5
0.479425538604


radarctan

mathematics

number

number

Outputs the inverse tangent of its input in radians.

show radarctan 0.5
0.463647609001


radcos

mathematics

number

number

Outputs the cosine of the input in radians.

show radcos 0.5


radsin

mathematics

number

number

Outputs the sine of the input in radians.

show radsin 0.5


radtan

mathematics

number

number

Outputs the tangent of the input in radians.

show radtan 0.5


raise ra

movement and vectors

turtle-units (number)

none

Raises (elevates) the currently selected turtle by the specified number of turtle-units. Draws a line if the pen is down. See lower

raise 20


ramp

shapes and graphics

width (number) | height (number) | depth (number)

none

Creates a filled wedge, or ‘ramp’ using the provided dimensions.

ramp 10 20 30


random rd

mathematics

maximum (number)

number

Returns a random integer (whole number) between 0 and the specified maximum, but not including that maximum. So, for example, random 2 returns one of two numbers, 0 or 1. random 8 returns one of 8 numbers, between zero and 7. Note that random and its input must be isolated from other expressions using brackets () if you don’t want a random number based on that expression, for example, unless you want random 15 + 10 to return a number between 0 and 34, you need to use (random 15) + 10 to return a number between 10 and 24

show random 16
3

show 1 + random 15
4

show (random 15) + 1
4


randombackgroundcolor randbg rbg

environment

none

none

Selects a random background color (0 – 15). See setbackgroundcolor

repeat 50 [randbg] setbg 0


randombackgroundshade randbs rbs

environment

none

none

Selects a random background shade (-12 to 12). See setbackgroundshade

randbs


randomboolean randbool

mathematics

none

boolean

Randomly returns TRUE or FALSE.

show randomboolean


randomfillcolor randfc rfc

shapes and graphics

none

none

Sets a random fill color (1 – 15) that is NOT the current fill color. See setfillcolor

randomfillcolor sphere 10


randomfillshade randfs rfs

shapes and graphics

none

none

Sets a random fill shade value between -12 and 12. See setfillshade

randomfillshade


randompencolor randpc rpc

shapes and graphics

none

none

Sets a random pen color (1 – 15) that is NOT the current pen color. See setpencolor

pendown repeat 10 [randvec randompencolor fd 100 home]


randompenshade randps rps

shapes and graphics

none

none

Sets a random pen shade value between -12 and 12. See setpenshade

randpenshade


randomtextcolor randtc

text

none

none

Sets a random text foreground non-black color

randomtextcolor


randomtextshade randts

text

none

none

Sets a random text shade.

randomtextshade


randomvectors [randvec]

movement and vectors

none

none

Orients the currently selected turtle randomly in three dimensions. This does NOT alter the current pitch, heading or roll values.

pendown repeat 10 [randomvectors fd 100 home]


range

words and lists

[startnumber endnumber (step)] (list)

list

Returns a list containing a range of numbers starting with startnumber and incrementing by one until and including endnumber, unless endnumber is less than one away from the current number. If the optional step value is included, range will step by that value, without overshooting. For an alternate method, see sequence

show range [1 10]
[1 2 3 4 5 6 7 8 9 10]

show range [0.5 10.25]
[0.5 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5]

show range [1 10 3]
[1 4 7 10]


rat

shapes and graphics

length

none

Creates a filled isosceles right angle triangle with two sides of the same specified length.

rat 20


rect

shapes and graphics

width (number) | height (number)

none

Creates a pen-drawn rectangle of the specified width and height to the front and right of the current turtle.

rect 10 20


readchar rc

input and output

none

character

Reads a character from the keyboard buffer and returns it. If there is no key in the buffer, it will wait for the user to press a key. See keyp

show readchar


readchars rcs

input and output

number

word

Reads the specified number of characters from the keyboard buffer and returns them as a single word. If there are insufficient keys in the buffer, readchars will wait for the user to press a sufficient quantity of keys to meet the required amount.

show readchars 5


recycle

environment

none

none

Forces the underlying Go language to run garbage collection. Garbage collection can cause a momentary pause intermittently. You can use recycle to time it better.

recycle


reader

input and output

none

filename

Outputs the name of the current file open for reading. You can change the current read file with the setread primitive. reader returns an empty list if the current reader is the keyboard.

print reader
/myfile.txt


readfile

input and output

filename

list

Returns a list of ‘long words’ (words with spaces), each long word in that list containing one line of the specified input file. You can use ‘parse’ to turn each long word into a list. See parse

show readfile "myfile.txt


readlist rl

input and output

none

list

Inputs a list from the keyboard OR currently open file. See question, readchar, setread

make "name readlist


readpos

input and output

none

number

Returns the current read position in the read file in bytes.

show readpos


readsector

environment

key (word)

value

Returns the value of the specified key in the sector of the selected zone currently inhabited by the calling turtle. See newzone, putsector

show readsector "key


readsectorindex

environment

sector (list) | container (word)

value

Returns the value of a specified container in the sector indexed by the given list, if all of these things exist.

show readsectorindex [5 5 5] "container


readsectorpos

environment

position (list) | container (word)

value

Returns the value of the specified container in the sector located at the given position, if all of these things exist.

show readsectorpos position "container


readtextline

text

line (number)

word

Returns the text on the given line. Note that the specified line is based on a 48 vertical line screen (counting from 0), so in 24 line mode (for example) you need to multiply the required line by 2.

show readtextline 0


readtextpos

text

[x y] (list)

char

Returns the character at the given text co-ordinates, based on a screen 100 characters wide and 48 characters high, starting at [0 0]. This is regardless of the current text size or screen width, so factor accordingly.

show readtextpos [20 20]


readword rw

input and output

none

word

Reads a ‘word’ from the keyboard or open file. As opposed to readlist, this input is returned as a word, or a ‘long word’ if it includes spaces. See readlist, setread

make "input readword


redo

input and output

none

none

Redo reverts the library of procedures in the current turtleSpace to those contained in the next (forwardly) available autosave – it redoes those changes. Hence it is only available after using undo. See undo for a better explanation.

redo


release

turtles

none

none

Erases all turtles except for Myrtle, Snappy and Libby, and any turtles that have defined procedures.

release


rem

environment

list

none

Short for remark, rem simply takes a list of text for the purposes of commenting. However, unlike comments created with semicolons, you can follow a rem with additional instructions on the same line. You can also retrieve the last ‘executed’ rem by viewing lastrem, which makes remarks useful for debugging, and removes the need to fill the text display with debug print output. See lastrem.

rem [This is a remark]
rem {|The value of "var is| :var}


reduce

words and lists

operation (word) | input (word or list)

output

invokes a combining function to join the members of an aggregate. Reduce takes two inputs. The first must be the name of a two-input operation; the second can be any word or list.

show reduce "word [C S L S]
CSLS

show reduce "sentence "UNICEF
[U N I C E F]


remainder re

mathematics

numerator (number) | denominator (number)

integer (number)

Returns the integer remainder of the division of the numerator by the denominator. The numerator and denominator are converted to integers if they are not provided as integers. For floating-point calculations, use mod

show remainder 22 7
1


remove

words and lists

index (number) | word or list

word or list

Returns a word or list without the specified character or list item.

show remove 2 [pig duck frog]
[pig frog]

print remove 4 "frog
fro


remprop

containers

name | property

none

Removes the given property from the named property list.

remprop "proplist "property


renamefile

input and output

source | destination

none

Renames a file.

renamefile "oldname "newname


renameproc

environment

source | destination

none

Renames a procedure.

renameproc "oldname "newname


renameturtle

turtles

oldname | newname

none

Renames a turtle.

renameturtle "fred "doug


rename

containers

oldname | newname

Renames a container.

rename “oldname “newname


render

environment

none

none

Enables global (all turtles) rendering of 3D graphics. See norender, which turns it off.

render


renderp

boolean

none

boolean

Returns true if rendering is enabled. See render.


repabove rpa

conditionals and flow

number

number

Returns the current iteration of a repeat loop at the specified level above the current repeat loop. For example, repabove 1 returns the repcount value of the repeat loop directly (one level) above the current repeat loop. If the repeat ‘scope’ specified by repabove does not exist, repabove returns 0. See repcount

show repabove 1


repcount rct

conditionals and flow

none

number

Returns the current iteration of a repeat loop. See repabove, loopcount

repeat 10 [print repcount]


repeat rpt

conditionals and flow

repetitions [list of requests to repeat]

none

Repeats the list of requests specified in square brackets the declared number of repetitions. See repcount

repeat 4 [forward 10 right 90]


replace

words and lists

index list value

list

Replaces the item at the specified index in the provided list with the provided value.

make "dogs replace 3 [doberman pug siamese] "chihuahua


replacecolumn

tables

name (word) | list of cell contents (list)

none

Replaces a column in the named table with the provided list of cells.

replacecolumn "table [1 2 3 4 5 6 7]


replacerow

tables

name (word) | list of cell contents (list)

none

Replaces a row in the named table with the provided list of cells.

replacerow "table [1 2 3 4 5 6 7]


replacetable

tables

name (word) | list of table contents (list)

none

Replaces the contents of a table with the provided list of cells. See table

replacerow "table [[1 2 3] [1 2 3] [1 2 3]]


replacetag

shapes and graphics

name (word) | list

none

Replaces the contents of the named tag with the contents of the provided list of turtle primitives.

replacetag "mytag [FD 20 RT 90 FD 20 RT 90]


reptotal

conditionals and flow

none

number

Returns the target number of loops inside a repeat. See repeat, repcount

repeat 10 [show reptotal]


request

control

turtle [list of instructions]

none

Performs the provided series of instructions once the specified turtle has no other workers executing. See interrupt for a more abrupt way of doing this

request "myrtle [sphere 50]


rerandom

environment

none

none

Resets the random number generator to the state ‘seeded’ at initialization (caused by restart, initialize or loading a turtleSpace). This causes a replication of the series of numbers generated by random.

rerandom


reset

environment

none

none

Clears the environment, erases all containers, halts all workers, returns all turtles to their home positions in all spaces. See resetspace

reset


resetage

control

none

none

Resets the current turtle’s age. See age

resetage


resetmodel

shapes and graphics

none

none

Resets the turtle’s model to its default.

resetmodel


resetspace

environment

none

none

Resets only the turtles in the current space, and space-specific parameters such as the background color.

resetspace


resettext

text

none

none

Resets the text layer to 60 columns, white on black, text size 1, default font.

resettext


resettime

environment

none

none

Resets the system timer to zero.

resettime


restart

environment

none

none

Restarts turtleSpaces.

restart


restore

environment

none

none

Restores a maximized window. See maximize

restore


restoretext

text

none

none

Restores the last text screen saved to the “stack”. If there are multiple savetexts, they can be progressively restored by using multiple restoretexts. See savetext

restoretext


resume

control

worker (number) or workers (list)

none

Resumes execution of the specified worker(s). See suspend, newworker

resume 7


resumemusic

sound and music

none

none

Resumes paused music playback.

resumemusic


retrieve

containers

database (word) | key (word)

none

Restores the values of the containers stored in the given database under the given key using the store primitive. For example, if you stored the containers :ducks and :pigs under the key “animals, then retrieving “animals would restore the values of :ducks and :pigs to the values they had when they are stored. See newdatabase, store

retrieve "farm "livestock
(show :pigs :ducks :cows)


reverse

words and lists

word, number or list

word, number or list

Reverses the order of the provided word, number or list.

print reverse 123
321

print reverse "duck
ckud

show reverse [pig duck frog cow]
[cow frog duck pig]


revert

input and output

none

none

Reverts to the last formal save, for example if you load a turtleSpace and muck about with it, but want to quickly return it to its original state.

revert


rhombus

shapes and graphics

width (number) | height (number)

none

Creates a 2D rhombus of the specified width and height.

rhombus 30 10


right rt

movement and vectors

degrees

none

Turns the selected turtle the specified number of degrees to the right. If the specified number of degrees is negative, turns it to the left. See left

right 90


rightarc rarc

movement and vectors

degrees | radius

none

Creates an arc forward and to the right from the turtle’s position, placing the turtle at its end. See leftarc

rightarc 90 40


rightbracket

words and lists

none

]

Returns a right bracket. Useful for times when turtleSpaces does not allow you to use a right bracket in isolation.

print rightbracket
]


rightdir

movement and vectors

none

vector

Returns the right vector of the selected turtle.

show rightdir


rightjustify

text

none

none

Right-justifies text output using print. See leftjustify

rightjustify


ring

shapes and graphics

thickness (number) | inner radius (number) | segments (number)

none

Creates a two-dimensional ring of the specified thickness, inner radius and segments. A segment number of 4 creates a square picture frame, while 3 creates a triangle. See ringarc

ring 10 30 10


ringarc

shapes and graphics

thickness (number) | inner radius (number) | totalsegments (number) | arcsegments (number)

none

Creates a partial ring of the specified number of segments. So, if the totalsegments specified were 10, an arcsegments value of 5 would create a half-ring.

ringarc 10 30 10 5


roll ro

movement and vectors

none

number

Returns the current roll value. See setroll

show roll


rollleft rl

movement and vectors

degrees (number)

none

Rolls the currently selected turtle to the left by the provided number of degrees.

rollleft 90


rollright rr

movement and vectors

degrees (number)

none

Rolls the currently selected turtle to the right by the provided number of degrees.

rollright 45


rope rp

shapes and graphics

length (number)

none

Draws a ‘rope’, a cylinder of the specified length, and places the turtle at its end, similar to mark or forward. You can set the diameter of the rope with setropewidth, and the number of sides the rope has using setropesides. See ropesides, ropewidth

rope 10


ropesides

shapes and graphics

none

number

Returns the number of sides of the cylinder drawn by rope. See setropesides

show ropesides


ropewidth

shapes and graphics

none

number

Returns the current width or radius of the rope. See setropewidth

show ropewidth


rotate

words and lists

index (number) | word or list

Makes index the first item in the output, followed by the remaining items after it in the input, then the items before it, starting with the first.

show rotate 5 [1 2 3 4 5 6 7 8 9]

[5 6 7 8 9 1 2 3 4]

show rotate 2 [pig duck frog]
[duck frog pig]

show rotate 4 "piglet
"letpig


round

mathematics

number

number

Takes a number and returns it rounded to the nearest whole number, up or down (whichever is closer).

print round 4.6
5

print round 1.2
1


row

tables

tablename | row

list

Returns the entire specified row of the specified table, formatted as a list. See column=

show row "mytable 5


run

control

list

none

Executes the provided list of primitives. This allows you to use various word and list functions to dynamically generate turtleCode into a list which can then be executed.

make "square [repeat 4 [forward 20 right 90]]
run :square


runprimitive

control

list

none

Executes the provided list of primitives and procedures with primitives given precedence over procedures (the opposite of normal execution). For example, if you have a procedure named forward, it would ordinarily override attempts to execute the forward primitive. However, if you pass forward to runprimitive, runprimitive will execute the forward primitive in preference to your procedure. You can also accomplish the same effect as runprimitive by prefacing a primitive with @. See examples

runprimitive [forward 20]
@forward 20


sample

shapes and graphics

image (word) | position (list)

RGBA (list)

Sample returns a list of the RGBA values of the pixel at the specified position (given in terms of percentages, measured from the bottom-left corner of the image) in the specified loaded image. For example, sample “frog [50 50] will return the color of the pixel located at 50% of frog’s height, and 50% of frog’s width. Sample can be used to determine the color of a pixel underneath a turtle, for example, by doing a bit of funky math.

show sample "frog [50 50]


sandbox

environment

[primitive1 primitive2…]

none

Restricts the calling turtle to executing ONLY the listed primitives. Shortcut variants MUST ALSO be declared, if availability is desired. Can be disabled with nosandbox, which either must be included in the list, or called by another turtle with no such restrictions (eg myrtle:nosandbox). See nosandbox

sandbox [forward fd right rt left lt]


save

input and output

none

none

Creates a save point in the current turtleSpace project.

save


savedatabase

input and output

database (word) | file (word)

none

Saves the specified database under the specified filename. See newdatabase, loaddatabase

savedatabase "database "mydb


savedictionary

input and output

dictionaryname | filename

none

Saves the given dictionary into a file with the given filename. See dictionary, newdictionary

savedictionary "mydict "dictfile


saveimage

shapes and graphics

image | filename

none

Saves an internally stored image. Useful for saving internally created or modified images.

saveimage "myimage "imagefile


savemodel

shapes and graphics

modelname (word) | modelfile (word)

none

Saves the specified model name into the specified model file. See loadmodel

savemodel "mymodel "modelfile.mdl


savepict

input and output

filename (word)

Saves a screenshot of the current output window into the specified filename. For high-resolution captures, use savepng

savepict “mypic.png


saveproc

input and output

procedure (word) | filename (word)

none

Saves the specified procedure into the specified file in the current working turtleSpace project.

saveproc "myproc "myproc.to


saveplot

input and output

filename (name) | plotname (name)

none

Saves the specified plot to the specified file. See plot

saveplot "myplotfile "myplot


savepng

input and output

[width height] (list) | name (string)

none

Saves a PNG image rendered using FauxGL using the specified dimensions into the current turtleSpace project folder, as opposed to savepict or snapshot which captures the current rasterized window image. savepng allows you to save extremely high resolution renders, but be careful, since it uses a lot of memory!

savepng [1920 1080] "mypicture.png


savestl

input and output

modelname (word)

none

Creates a folder in the current project folder called modelname.mdl and exports a series of STL files inside it containing the current displayed vectors, one for each color displayed. These can be used with 3D printers, although they may need to be ‘validated’ by another application first (and the sides potentially extruded). See setstllinethickness, which sets the radius of exported lines (they are exported as ropes) See also savestlmono, which saves a single amalgamated STL file

savestl "mymodel


savestlmono

input and output

modelname (word)

none

Creates a folder in the current project folder called modelname.mdl and exports a single STL files inside it containing the current displayed vectors as a single color. This can be used with 3D printers, although it may need to be ‘validated’ by another application first (and the sides potentially extruded). See setstllinethickness, which sets the radius of exported lines (they are exported as ropes) and savestl, which separates the vectors by color

savestlmono "mymodel


savetable

tables

tablename (word) | filename (word)

none

Saves the specified table to disk using the specified filename.

savetable "mytable "mytable.tbl


savetag

shapes and graphics

tagname (word) | tagfile (word)

none

Saves the contents of the specified tag to the specified filename. See loadtag

savetag "mytag "tagfile


savetext

text

none

none

Saves the contents of the text screen to a “stack”, see restoretext

savetext


savetrack

shapes and graphics

filename

none

Saves the calling turtle’s ‘turtle track’ to a file.

savetrack


saveturtle

turtles

filename

none

Saves the calling turtle’s procedures to a file.

saveturtle


say

sound and music

word or list

none

Causes the operating systems speech-synthesis (if available) to speak the given word or list. Note that this may not be available on some systems, and should not be used as a primary means of communicating with the user.

say "hello


scol

tables

table (word) | [column value (variance)] (list)

list

Searches a given column in the given table for the given value, within the optionally provided variance if numeric. See srow

show scol "table [4 6 2]


search

words and lists

searchmask (word) | list

list

Returns any items in the provided list that match the provided search mask, which can contain asterisks * which ‘wildcard’ the start or the end of the search mask (and return results that match any characters trailing or leading the search mask) or question marks ? that wildcard a single character. For example, fr* would match both free and frog, while f?r would match for and far.

show search "fr* [frog fred duck]
[frog fred]


searchp

boolean

searchmask (word) | list

boolean

Returns true if the specified search would return a result. See search

show searchp "pig [pig frog duck]
TRUE


second

words and lists

word, list or number

letter, word, list or number

Returns the second item in a word, list or number. See also first, third

print second 345
4

print second [dog pig duck]
pig

print second "frog
r


seconds

environment

none

seconds (number)

Returns the current seconds value from the system clock. See hours, minutes

show seconds


sectorkeys

environment

none

list

Returns the available keys in the sector currently inhabited by the calling turtle. See newzone, putsector

show sectorkeys


selectplot

shapes and graphics

name (word)

none

Selects the named plot for use with plot, unplot, plotcol. See plot

selectplot "myplot


selectspace

environment

space (word)

none

Selects and moves the calling turtle to the given space. This space must have been first created with newspace. The turtle’s track moves with the turtle to the new space.

selectspace "innerspace


selectuser

environment

name (word)

none

Selects the specified user as the current operating user.

selectuser "Bonnie


selectzone

environment

name (word)

none

Selects a zone to read sectors from. See zones, newzone

selectzone "zone


sentence se

words and lists

word | word

list

Creates a list from the given words. If brackets are placed around the sentence primitive and its inputs, it can take one or as many inputs as required.

make "var sentence "duck "pig
(show sentence "duck "pig "cow)
[duck pig cow]


sequence

mathematics

[from | to | count] (list)

list (list)

Similar to range but outputs a list of numbers starting with the first parameter, then takes a number of equally-spaced steps specified by the third parameter to reach the number given in the second parameter. See range

show sequence [1 10 6]
[1 2.5 4 5.5 7 8.5 10]


set

containers

surname | container | value

none

Sets the contents of the named container in the named surname to the provided value. See setsurname, surname, get

set "jones "car "camry


setabout

environment

word

none

Sets the description of the current turtleSpace. This is a ‘long word’, a string bracketed by pipes |. It can also be edited in the ed editor.

setabout |This is my turtleSpace!|


setambient

turtles

RGBA (list)

none

Sets the ambient light values (red, green, blue, and opacity) of the calling turtle, if the turtle is acting as a light. See ambient

setambient [50 50 50 100]


setanchor

movement and vectors

position

none

Sets the selected turtle’s orbit anchor to the specified three-dimensional position. Compare with fixate.

setanchor [0 0 0]


setarrowdistance

turtles

distance (number)

none

Sets the distance the turtle’s directional arrow is from the turtle’s position. See showarrow, hidearrow

setarrowdistance 10


setarrowsize

turtles

size (number)

none

Sets the size of the turtle’s directional arrow. See showarrow, hidearrow


setattenuation

sound and music

number

none

Default is 0.3. When a sound is played, the distance between the emitter and receiver (view turtle) is multiplied by the attenuation value to calculate the resultant volume of the sound at the receiver. Basically this makes sounds quieter the farther away the view turtle is from the turtle making the sound. This is a global setting that affects all turtles. See attenuation, attenuate

setattenuation


setbeep

sound and music

word

none

Sets the system beep to the sound named by the provided word. See beep

setbeep "sheep
beep


setbackgroundcolor setbg sbg

environment

number

none

Sets the background color to the color index referenced by the provided number. Note that you can use the color names referenced in the colors primitive description, because they are actually functions which return the corresponding index number.

setbackgroundcolor 5
setbg yellow


setbackgroundshade setbs sbs

environment

shade (number)

none

Sets the shade of the pen color to be displayed when rendering subsequent lines. It can be set to a number from 0 to 15, which represents a decrease in brightness of the pen color of 6.25 times that number. So, a value of 8 decreases the brightness by 50%.

setbackgroundshade 5


setbounds sbds

movement and vectors

x1 y1 x2 y2 (list) OR [[x1 y1 z1][x2 y2 z2]] (list of lists)

none

Sets the boundary used by wrap and fence

setbounds [-100 -100 100 100]
setbounds [[-100 -100 -100][100 100 100]


setcursor

text

[column (number) | row (number)] (list)

none

Moves the text cursor to the specified column (x) and row (y).

setcursor [10 10]


setcursorchar

text

char (word)

none

Sets the text cursor to the provided character.

setcursorchar "X


setdiffuse

turtles

RGBA

none

Sets the diffuse light RGBA values of the calling turtle, if that turtle is acting as a light. See diffuse

setdiffuse [50 50 50 100]


setdotsize

shapes and graphics

size (number)

none

Sets the calling turtle’s dot size. All of a turtle’s dots are of the same size, but different turtles can have different-sized dots. See dotsize, dot, dotp.

setdotsize 5


setfillcolor setfc sfc

shapes and graphics

color (number)

none

Sets the ‘fill’ color used by the turtle when creating shapes.

setfillcolor 3
setfillcolor blue


setfillshade setfs sfs

shapes and graphics

shade (number)

none

Sets the shade of the fill color to be displayed when rendering subsequent shapes. It can be set to a number from 0 to 15, which represents a decrease in brightness of the fill color of 6.25 times that number. So, a value of 8 decreases the brightness by 50%. Negative shade values add 1/16th of the difference between each of the base RGB values of the color and 255

setfillshade 5


setfillopacity setfo

shapes and graphics

opacity (number)

none

Sets the fill opacity, takes a number from 0 to 100.

setfillopacity 50


setfluidangle

turtles

angle (number)

none

Sets the angular increments by which the turtle turns when fluid mode is on. See fluid

setfluidangle 5


setfluidstep

turtles

steps (number)

none

Sets the step increments by which the turtle moves when fluid mode is on. See fluid

setfluidstep 1


setframeinterval

environment

milliseconds

none

(webLogo only) Sets the interval between rendering cycles. This can speed up webLogo use when drawing complicated scenes. See frameinterval

setframeinterval 200


sethatchlimit

turtles

number

none

Sets the number of hatchlings that can be hatched every second.

sethatchlimit 100


setheading seth shd

movement and vectors

degrees (number)

none

Sets the turtle’s heading (left-right) and updates its orientation appropriately. Be aware that while setheading will alter the value of heading for the purposes of orientation, setorientation may not restore the expected turtle orientation if setheading is used in isolation. If you intend to use setorientation to restore a turtle’s orientation, you should use setorientation to change aspects of a turtle’s orientation also. See orientation

setheading 90


seticosphereiterations sisi

shapes and graphics

number

none

Sets the complexity of the icosphere, from 0 to 3

seticosphereiterations 3


setinstrument

sound and music

instrumentfile (word)

none

Loads an instrument file (saved from tracker) for use with playnotes. See tracker, playnotes

setinstrument "xylophone.snd


setitem

index (number) | container (word) | value

none

Replaces the character or item at the specified index in the container with the given value, depending on if the value stored in the container is a word or a list.

make “animals [pig duck cow]

setitem 3 "animals "frog
show :animals
[pig duck frog]

make "animal "cow
setitem 4 "animal "s
show :animal
sow


setlight

turtles

number

none

Sets the light status of the calling turtle to either 0 (not a light), 1 (spot light) or 2 (point light). See light

setlight 1


setlinesnormal

shapes and graphics

vector (list)

none

Sets the ‘normal’ vector to be used by lightlines. All lines use the same vector. This is easiest taken from a turtle. Remember that if you take the forwarddir from Snappy, you will need to reverse it, using vectorsub! See lightlines

setlinesnormal vectorsub snappy:forwarddir [0 0 0]


setmarkerwidth smw

shapes and graphics

radius (number)

none

Sets the width of the mark primitive. The default is 2. See mark

setmarkerwidth 10


setmodel

turtles

modelname (word) OR [list of instructions]

none

Sets the turtle model to the specified model name or constructs it using the given list of instructions. See newmodel, setmodelscale Built-in models: myrtle, turtle, spaceship, astronaut, plane, invisible

setmodel "plane


setmodelorigin

movement and vectors

none

none

setmodelorigin sets the current position and vectors of the turtle drawing the turtle model. These are restored using modelhome. Since the turtle model is redrawn every time the turtle moves, these values are automatically updated and used based on the turtle’s current position. See modelhome, newmodel

setmodelorigin


setmodelscale

turtles

ratio (number)

none

Scales the turtle’s model based on the given ratio.

setmodelscale 2


setmusicspeed

sound and music

speed (number)

none

Sets the speed of music playback.

setmusicspeed 128


setmusicvolume

sound and music

percent (number)

none

Sets the volume (amplitude) of music playback using a value from 0 to 100.

setmusicvolume 50


setnoteschannel

sound and music

number

none

Sets the music channel to be used to play back notes with playnotes

setnoteschannel 1


setnotespeed

sound and music

speed (number)

none

Sets the speed of note playback.

setnotespeed 128


setorbitdistance

movement and vectors

turtle-units (number)

none

Sets the currently selected turtle’s distance from its anchor point.

setorbitdistance 100


setorientation

movement and vectors

vectors (list)

none

First unwinds the current orientation in the reverse of orientationorder, then changes the calling turtle’s orientation in the order specified by orientationorder, so that if orientationorder is “PHR then the first orientation changed is pitch, then heading, then the roll. Due to the nature of 3D movements, setorientation can only be used to restore orientations that are the result of relatively simple transforms (that is, series of orientation changing commands such as rollright or down). To restore complex orientations, use both setorientation and setvectors. See setvectors

setorientation [0 90 0]


setorientationorder

movement and vectors

order (word)

none

Sets the order in which heading, pitch and roll are processed after using setheading, setpitch or setroll. The required word is a three letter combination made up of h, for heading, p, for pitch, and r, for roll. See orientationorder

setorientationorder "hpr
setorientationorder "rhp


setorigin

movement and vectors

[x y z] (list)

none

Sets the turtle’s origin, the location it goes when it goes home. See origin, home

setorigin [50 50 50]


setoriginvectors

movement and vectors

vectors (list)

none

Sets the turtle’s origin vectors, the orientation the turtle ends up in when it goes home. See originvectors, vectors, home

setoriginvectors vectors


setoverlayresolution

shapes and graphics

name (word) | ratio (number)

none

Sets the resolution or pixel density of the named overlay, based on a ratio where 1 is 512 pixels by 384 pixels (at a 16:9 ratio)

setoverlayresolution "myrtlesview 2


setoverlaytransparency

shapes and graphics

name (word) | boolean

none

Turns on background transparency for the specified overlay. If transparency is off, the background color in the overlay view is solid.

setoverlaytransparency "myrtlesview on


setoverlayupdate

shapes and graphics

name (word) | frames per second (number)

none

Sets the update frequency of the named overlay to the provided number of frames per second. See newoverlay

setoverlayupdate "myrtlesview 10


setpath

input and output

path (word)

none

Sets the current file path. Root / is the current user folder.

setpath "/


setpencolor setpc spc

shapes and graphics

color (number)

none

Sets the pen color to the provided color index. Note that there are a number of color functions that return their corresponding numbers, such as yellow and blue, that can be used in place of a number. See colors

setpencolor yellow
setpc 13


setpenshade setps sps

shapes and graphics

shade (number)

none

Sets the shade of the pen color to be displayed when rendering subsequent lines. It can be set to a number from 0 to 15, which represents a decrease in brightness of the pen color of 6.25 times that number. So, a value of 8 decreases the brightness by 50%.

setpenshade 5


setpenopacity setpo

shapes and graphics

number

none

Sets the pen’s opacity. Takes a number from 0 to 100.

setpenopacity 50


setpenwidth spw

shapes and graphics

number

none

Sets the width of the pen. In turtleSpaces, this sets the pen width globally, that is the setting applies both to lines already drawn and subsequently drawn lines. If you want to draw lines of varying widths, use mark

setpenwidth 5


setpitch setp spi

movement and vectors

degrees (number)

none

Sets the turtle’s pitch (up-down) and updates its orientation appropriately. Be aware that while setpitch will alter the value of pitch for the purposes of orientation, setorientation may not restore the expected turtle orientation if setpitch is used in isolation. If you intend to use setorientation to restore a turtle’s orientation, you should use setorientation to change aspects of a turtle’s orientation also. See orientation

setpitch 180


setpos spo

movement and vectors

[x y] (list)

none

Sets the x and y co-ordinates of the calling turtle’s position. If the pen is down, a line is drawn between the turtle’s old position and new position. Does not affect z. Exists for compatibility with two-dimensional logos.

setpos [20 30]


setposition spn

movement and vectors

[x y z] (list)

none

Sets the turtle’s co-ordinates. If the pen is down, a line is drawn between the turtle’s old position and its new position.

pendown repeat 100 [setposition {-200 + random 400 -200 + random 400 -200 + random 400}]


setprefix

input and output

path

none

Sets the path for file operations. / is always the root of the user’s folder

setprefix "/


setpremodel

turtles

instructions [list]

none

Allows you to insert instructions between the end of the turtle track and the start of the model. Mostly used to alter the orientation of the model, for example to point the turtle upwards when orbiting a point, rather than pointing at the point, as in the startup animation, or to rotate the model without affecting its logical orientation.

setpremodel [up 90]


setread

input and output

filename (word)

none

Sets a file previously opened with ‘open’ to be read from using readchar, readchars, readword or readlist. setread ” returns input to the keyboard. See open, close, setreadpos, setwrite

setread "inputfile
setread "


setreadpos

input and output

bytes (number)

none

Sets the read position of the current ‘reader’ (the input file set using setread). The provided number must be between 0 and the length of the file.

setreadpos 100


setroll setr sro

movement and vectors

degrees (number)

none

Sets the turtle’s roll (rollleft-rollright) and updates its orientation appropriately. Be aware that while setroll will alter the value of roll for the purposes of orientation, setorientation may not restore the expected turtle orientation if setroll is used in isolation. If you intend to use setorientation to restore a turtle’s orientation, you should use setorientation to change aspects of a turtle’s orientation also. See orientation

setroll 90


setropesides

shapes and graphics

sides (number)

none

Sets the number of sides of the cylinder created by the rope primitive. The default is 10. See rope, ropesides

setropesides 3


setropewidth

shapes and graphics

number

none

Sets the circumference of the ‘rope’. See rope, ropewidth, ropesides


setsectorindex

environment

sector (list) | container (word) | value

none

Sets the value of a specified container in the sector indexed by the given list, if all of these things exist.

setsectorindex [5 5 5] "container :value


setsectorpos

environment

position (list) | container (word) | value

value

Sets the value of the specified container in the sector located at the given position to the given value, if all of these things exist.

setsectorpos position "container :value


setsheet

tables

table (word) | sheet (number)

none

Sets the ‘sheet’ (third dimension) used by the table commands srow, scol, replacerow, replacecolumn, row and column

setsheet "table 2


setsoundvolume

sound and music

volume (number)

none

Sets the volume of digital and analog sound playback using a range of 0 to 100, where 0 is off and 100 is full. This is turtle-specific. See setmusicvolume

setsoundvolume 50


setspecklecolors

shapes and graphics

list

none

Takes a list of colors to be used in the generation of speckle patterns. If you want to weight a random speckle towards a particular color, simply include it more than once in the request, such as the example below.

setspecklecolors [1 1 1 1 2 2 3]
setspecklecolors {:col1 :col1 :col2}


setspeckleplot

shapes and graphics

plotname (word)

none

Selects the name of the plot to use to generate a speckle, if using the plot style with speckle.

setspeckleplot "myplot


setspecklesize

shapes and graphics

turtleSteps

none

Sets the pixel size used in generating speckles, in turtleSteps.

setspecklesize 1


setspecklestyle

shapes and graphics

“styletype

none

Selects the style to use when generating speckles. You can choose from “repeat “dither “random or “plot.

setspecklestyle "random


setspecular

turtles

RGBA (list)

none

Sets the specular RGBA values of the calling turtle, if the turtle is acting as a light. See specular

setspecular [50 50 50 100]


setspeed sspd

turtles

microseconds (mumber)

none

Sets the number of microseconds the turtle sleeps between executing each instruction, an instruction being a fully formed statement, such as print position, or right sum 20 30. The default is 500 (half of a millisecond). Note that if you set this to a low value, or 0, you may use a large percentage of your host computer’s available CPU time, and may cause issues with your operating system’s overall performance! See speed

setspeed 200


setspheroidaxis ssa

shapes and graphics

boolean

none

Sets the axis by which spheroids are stretched. 0 is equatorial while 1 is polar. See spheroidaxis

setspheroidaxis 1


setspotcutoff

turtles

number

none

Sets the spot light cutoff value of the calling turtle, if that turtle is a light. See spotcutoff

setspotcutoff 1


setspotexp

turtles

number

none

Sets the spot light exponent value of the calling turtle, if that turtle is a light. See spotexp

setspotexp 0


setsquelch

sound and music

number

none

Sets the ‘squelch’ value, sounds with a(n attenuated) volume under that specified value will not be sent to the audio engine for processing (they will not play.) There are a limited number of audio channels for sounds, and squelch will prevent them from being filled up with barely audible sounds. Squelch is a global setting that affects all turtles in all spaces. See squelch

setsquelch 50


setsurname

“surname

none

Used to select the ‘surname’, otherwise more commonly known as the ‘container space’, to use. All the containers (or variables) in turtleSpace have a surname, or family they belong to. Changing the surname allows you to use code containing single-dimension containers in different contexts (for example, different players) without having to modify it. You just set a different surname and run the code again. The default surname is “default

setsurname “player1

make "score 5
setsurname "player2
make "score 10
setsurname "player1
print :score
5


setstate

turtles

state (list)

none

Sets the turtle’s state. See state

setstate snappy:state


settextbackground settb

text

color (number)

none

Sets the text background color to the provided number.

settextbackground 5
settextbackground yellow


settextcolor settc

text

foregroundcolor (number) | backgroundcolor (number)

none

Sets the text color. Requires both foreground and background text colors to be specified. See settextforeground and settextbackground

settextcolor [2 15]


settextfont

text

font-id

none

Sets the text font, based on a font-id number. 0 is the default high-resolution font. 1 is the Apple II system font. 2 – 5 are stylised low-resolution fonts (fantasy, computer, sci-fi)

settextfont 1


settextforeground settf

text

color (number)

none

Sets the text foreground color to the provided number.

settextforeground 2
settextforeground blue


settextshade setts

text

number

none

Sets the ‘shade’ or brightness of the text color. settextshade can take a value from 0 (normal) to 15 (darkest). Negative values are not valid for settextshade. Affects both foreground _and_ background. Note that the prompt resets the text shade and so its effect will not be obvious if you simply enter it at the prompt!

settextshade 10


settextsize setts

text

size (number)

none

Sets the text size, where 0 is the smallest text size.

settextsize 1


settextwindow

text

x1 y1 x2 y2 (list)

none

Sets the area of the text screen to write in. Note that the parameters are based on a 100 by 48 column screen, regardless of current text size.

settextwindow [10 10 70 30]


settitle

input and output

name (word)

none

Sets the title of the current turtlespace. Renames the current untitled turtlespace folder or changes the title of the currently open workspace folder. To create a new turtlespace, see initialize

settitle "MyGame


setstllinethickness

input and output

radius (number)

none

Sets the thickness of the rope used to represent lines in models exported using savestl.

setstllinethickness 10


setturtle tu

turtles

turtlename (word)

none

Sets the turtle to execute as to the provided turtlename. Shortcut is tu

setturtle myrtle
tu snappy


settypedelay stde

shapes and graphics

60ths-of-a-second (number)

none

Sets a delay between the rendering of each letter rendered by ‘typeset’. This delay is specified in 60ths of a second – 60 equalling one second. See typeset

settypedelay 60


settypedepth std

shapes and graphics

turtle-units (number)

none

Sets the depth of three-dimensional type created by ‘typeset’. See typeset

settypedepth 3


settypefont stf

shapes and graphics

font-id (number)

none

Sets the font used for ‘typeset’. Default is 1. See settextfont

settypefont 1


settypefilled stfi

shapes and graphics

boolean

none

If set true (default), typeset and inscribe create ‘filled’ characters. If false, they create lined cube characters.

settypefilled false


settypesize sts

shapes and graphics

size (number)

none

Sets the size (in turtle units) of the font used by typeset and inscribe. See typeset

settypesize 10


settypestretch str

shapes and graphics

ratio

none

Stetches text rendered using typeset or inscribe by the specified ratio.

settypestretch 2


setvar

containers

turtle (word) | container (word) | value (word, number, list or boolean)

none

Changes the contents of the container held by the specified turtle to the specified value. Technically bad form, but sometimes necessary.

setvar "myrtle "container 50


setvectors

movement and vectors

[[forwarddir] [updir] [rightdir]] (list of lists)

none

Sets the current turtle’s orientation using vectors.

setvectors [1 -1 0] [1 1 1] [0 0 0]


setview sv

shapes and graphics

turtle (word)

none

Sets the current “view turtle” – the turtle from whose viewpoint the display is generated.

setview "myrtle


setviewfar

shapes and graphics

distance (number)

none

Sets the far clipping plane, the distance at which OpenGL objects stop being rendered or are clipped. This must be set by the view turtle. See setviewnear

setviewfar 1000


setviewfov

shapes and graphics

angle (number)

none

Sets the turtle’s viewing angle, the angle of view displayed in the window. The default is 60

setviewfov 60


setviewnear

shapes and graphics

distance (number)

none

Sets the near clipping plane. OpenGL objects closer than this distance are not rendered or are clipped. This must be set by the view turtle. See setviewfar


setviewpoint

shapes and graphics

list

none

Positions the view by the provided [X (left-right) Y (down-up) Z (back-forward)] list of turtle units, where a negative value has the first effect and a positive value has the second effect.

setviewpoint [10 -10 0]


setviewvectors

shapes and graphics

vectors (list)

none

Sets arbitrary view vectors for the current turtle. When selected as a view (camera) turtle, if viewvectors are set the display will always be rendered in the direction and orientation specified by those vectors, regardless of the turtle’s orientation. To return to using the turtle’s orientation, specify an empty list, eg: setviewvectors []

setviewvectors vectors


setvolume

sound and music

volume (number)

none

Sets the overall volume level, taking a value from 0 (off) to 100 (full).

setvolume 50


setwidth

text

columns (number)

none

Sets the width of the text screen in columns. Valid values are 40, 50, 60, 80 and 100.

setwidth 60


setwindowpos

environment

[x y] (list)

none

Positions the turtleSpaces application window given the specified x and y (top-left) co-ordinates.

setwindowpos [50 50]


setwindowsize

environment

size (y)

none

Sets the turtleSpaces window’s height, and by extension its width, as the turtleSpaces window is fixed to a 16:9 ratio.

setwindowsize 20


setwrite

input and output

filename (word)

none

Sets the previously ‘open’ed file or output device for writing. setwrite ” returns output to the interactive text area. See open, close, setread

setwrite "file
setwrite "api
setwrite "webtext


setwritepos

input and output

byte (number)

none

Sets the write position in the currently opened file. See setwrite

setwritepos 60


setx

movement and vectors

number

none

Sets the turtle’s x position.

setx 100


setxy

movement and vectors

x (number) | y (number)

none

Sets the turtle’s x and y co-ordinates. This is here for compatibility. As opposed to setpos, which takes the two co-ordinates as a list. See setpos

setxy 10 20


sety

movement and vectors

number

none

Sets the turtle’s y position.

sety 20


setz

movement and vectors

number

none

Sets the turtle’s z position.

setz 50


setzoom

shapes and graphics

percentage (number)

none

Sets the view turtle’s camera ‘zoom’ – the default is 100%

setzoom 50


shard

shapes and graphics

depth (number)

none

Creates a ‘shard’ or a three-dimensional fragment using the current and two previous turtle positions with a depth specified by its input parameter.

shard 10


share

“name

none

Indicates that the container “name should be shared amongst all turtles.

share “lives


shares

containers

none

list

Returns a list of all the currently shared containers.

show shares


sharep

boolean

“sharename

boolean

Returns true if the specified “sharename exists.

show sharep "sharename


sharevectors

input and output

none

URL

Returns a shareable URL that contains a web view version of the currently displayed vector information. It also displays the sharing user and project description (about). The viewer has a simple camera mechanism, and so models are best oriented to the camera’s typical starting position. It also contains a link allowing for the opening of the current workspace in webLogo. See setabout

sharevectors


sheet

tables

table (word)

sheet (number)

Returns the current sheet number for the given table. See setsheet

show sheet "table


shortest

words and lists

list

number

Returns the item number of the first shortest item in the list by number of characters or digits. See count

print shortest [pig duck cow]
1

print shortest [1000 100 10]
3


show

text

input

none

Prints the supplied input to the screen (or file if setwrite is enabled), with brackets around lists, if appropriate, followed by a carriage return. Compare with print, type

show [duck pig]
[duck pig]


showall

turtles

none

none

Shows all turtles. See hideall

showall


showanchor

environment

none

none

Shows the location of the turtle’s anchor with a red ball. See hideanchor, anchor

showanchor


showarrow

turtles

none

none

Shows the directional arrow, which indicates the direction the turtle is facing. See hidearrow, setarrowsize, setarrowdistance

showarrow


showcolors sc

text

none

none

Shows a colored list of built-in colors. The following colors have named primitives that return their numerical value (eg black returns 0):

black
red
blue
magenta
green
grey
mediumblue
lightblue
brown
orange
lightgrey
pink
lightgreen
yellow
cyan
white

setfillcolor red
setpencolor blue


showcursor

text

none

none

Shows the text cursor.

showcursor


showme

movement and vectors

turtle

none

Causes the calling turtle to position itself in the default view turtle position over the specified turtle. Usually called by the current view (camera) turtle.

showme "myrtle


showmouse

environment

none

none

Shows the mouse cursor. See hidemouse

showmouse


shownp

boolean

none

boolean

Returns true if the turtle is not hidden, false if it is.

show shownp
TRUE


showoverlay

shapes and graphics

name (word)

none

Shows the specified overlay. See newoverlay

showoverlay "myrtlesview


showplot

shapes and graphics

plotname (word)

none

Shows (all) the named plot(s). If you want to show / hide one specific instance of a placed plot (since you can place multiple), place them inside of a tag. See tag, hideplot, plot

showplot "myplot


showsticker

shapes and graphics

name (word)

none

Shows the sticker with the provided name. See placesticker

show "marquee


showtag

shapes and graphics

tag (word)

none

Shows (makes visible) the specified tag. See tag

showtag "mytag


showtrack

shapes and graphics

none

none

Shows the calling turtles ‘turtle track’ or visible output. See hidetrack

showtrack


showturtle st

turtles

none

Causes the turtle to display if hidden.

showturtle


sin

mathematics

degrees

sine of degrees

Returns the sine of degrees.

print sin 90


shuffle

words and lists

list

list

Randomly re-orders contents of provided list.

show shuffle [1 2 3 4 5]
[3 1 5 4 2]

show shuffle [frog duck pig]
[pig frog duck]


shutdown

environment

none

none

Shuts down turtleSpaces.

shutdown


sinceactive

turtles

turtlename

milliseconds

Returns the number of milliseconds since the turtle added to its track, by moving, creating an object or changing a turtle parameter such as the pen color.

print myrtle:sinceactive


skewfiso skf

shapes and graphics

width (turtle-units) | height | degrees

none

Creates a filled isosceles triangle “skewed” by the given number of degrees in the X axis. Negative degree values are an acceptable input. See fiso

skewfiso 50 100 45


skewiso ski

shapes and graphics

width (turtle-units) | height | degrees

none

Creates an isosceles triangle “skewed” by the given number of degrees in the X axis. Negative degree values are an acceptable input. See iso

skewiso 50 100 45


skewpyramid skp

shapes and graphics

size (turtle-units) OR [width height depth] (list) | degrees X | degrees Z

none

Creates a pyramid “skewed” by the specified number of degrees in the X and Z directions.

skewpyramid 50 45 45


skewpyramoid skpo

shapes and graphics

size (turtle-units) OR [width height depth] | stretch (ratio) | degrees X | degrees Z

none

Creates a pyramid “skewed” by the specified number of degrees in the X and Z directions, and stretched by the specified ratio

skewpyramoid 50 3 45 45


skewquad skq

shapes and graphics

width (turtle-units) | height (turtle-units) | degrees

none

Creates a quad “skewed” by the specified number of degrees, a value which can be negative. See quad

skewquad 50 50 45


skewrect skr

shapes and graphics

width (turtle-units) | height | degrees

none

Creates a “skewed” rectangle of the given width and height, skewed by the specified number of degrees, a value which can be negative.

skewrect 100 50 -45


skewtraperect sktr

shapes and graphics

width (turtle-units) | height | ratio | degrees

none

Creates a “skewed” trapezoidal rectangle of the specified width and height, whose top is affected by the provided ratio and who is skewed by the specified number of degrees, a value which can be negative. See rect

skewtraperect 100 100 0.5 45


skewtrapevoxeloid skvo

shapes and graphics

width | height | depth | ratio-W | ratio-D | degrees X | degrees Z

none

Creates a skewed trapezoidal voxel, the width and depth of whose “top” or side in front of the turtle is stretched or contracted by the given ratios (depth and width), and who is then skewed by the given degree values in the X and Z axis, which can be negative. See trapevoxeloid

skewtrapevoxeloid 50 50 50 0.5 2 45 45


skewtrapezoid skt

shapes and graphics

width (turtle-units) | height | ratio | degrees

none

Creates a skewed trapezoidal quad of the specified width and height, whose top is affected by the provided ratio and who is skewed by the specified number of degrees, a value which can be negative.

skewtrapezoid 100 100 0.5 45


skewvoxeloid skv

shapes and graphics

width (turtle-units) | height | depth | degrees X | degrees Z

none

Creates a “skewed” voxeloid of the specified dimensions, distorted on the X and Z axis by the specified number of degrees, which can be negative.

skewvoxeloid 100 100 100 45 45


sleep

control

milliseconds

none

Causes execution to pause for the specified number of milliseconds. Useful when working with time to calculate delays. Alternative to wait.

sleep 1000


slideleft sl

movement and vectors

turtle-steps

none

‘Slides’ the turtle to the left the given number of turtle-steps.

slideleft 20


slideright sr

movement and vectors

turtle-steps

none

‘Slides’ the turtle to the right the given number of turtle-steps.

slideright 30


smallest

words and lists

list

number

Returns the numerically smallest item in the provided list.

show smallest [10 100 1000]
1


snapshot

input and output

imagename (word)

none

Takes a snapshot of the screen and places it into the internal image library with the given imagename. That image can then be used with ‘sample’ to provide basic 2D collision detection, or used on a ‘billboard’. See listimages, sample, billboard

snapshot "screenshot


snappy

turtles

none

“snappy

Snappy is the default ‘view’ turtle, one of the three turtles created when a space is initialized, and the first turtle from whose perspective you see when you start up turtleSpaces. While other turtles (except for Libby) can both create things and be seen out from, Snappy can only move and be used as a view turtle, and cannot create items in his ‘turtle track’ (eg create lines or shapes). See myrtle, libby

setview snappy


solo

control

none

none

Stops all threads running in the calling turtle except the thread executing solo, if that thread belongs to that turtle.

solo


sort

tables

tablename (word) | column (number)

none

Sorts the specified table on the given column, low to high.

sort "table 3


soundp

boolean

soundname (word)

boolean

Returns true if the specified sound is loaded in memory.

show soundp "mysound


space

environment

none

word

Returns the current space.

show space


spacep

boolean

word

boolean

Returns true if the specified space is defined.

show spacep "home
true


soundvolume

sound and music

none

number

Returns the current sound volume.

show soundvolume


spaces

environment

none

list

Returns a list of the currently defined spaces

show spaces


speckle

shapes and graphics

none

none

Enables ‘speckling’ (generated pixelated texturing) of any following square, quad, voxel and voxeloid shapes. These are configured using setspecklestyle (repeat, random or plot), setspecklecolors, setspecklesize and optionally setspeckleplot. nospeckle disables speckling

speckle


specklecolors

shapes and graphics

none

list

Returns the currently defined speckle colors. See speckle

show specklecolors


specklep

boolean

none

boolean

Returns true if speckle is enabled. See speckle

show specklep


speckleplot

shapes and graphics

none

word

Returns the plot currently used by speckle in the plot style. See setspecklestyle

show speckleplot


specklesize

shapes and graphics

none

number

Returns the currently defined speckle size. See setspecklesize, speckle

show specklesize


specklestyle

shapes and graphics

none

word

Returns the current speckle style. See speckle

show specklestyle
"random


specular

turtles

none

none

Returns the specular RGBA values of the calling turtle, if that turtle is acting as a light. See setspecular

show specular


speed

turtles

none

microseconds (number)

Returns the current speed value, the number of microseconds the turtle ‘sleeps’ between the execution of each instruction. The default speed value is 500 microseconds, or half a millisecond. See setspeed

show speed


sphere sph

shapes and graphics

radius (number) | stacks (number) | sectors (number)

none

Creates a sphere of the specified radius using the specified number of stacks and the specified number of sectors. Small stack and sector values create interesting shapes. As opposed to icosphere

sphere 20 10 10


sphereslice sphs

shapes and graphics

radius (number) | stacks (number) | sectorstotal (number) | sectorsused (number)

none

Creates a partial sphere of the overall specified radius, using the specified number of vertical ‘stacks’, and specified number of horizontal ‘sectors’, based on the given total number of sectors, and the used (displayed) number of sectors. Like an orange cut vertically. See cutsphere, cutsphereslice

sphereslice 20 10 10 5


spheroid spd

shapes and graphics

radius (number) | stacks (number) | sectors (number) | multiplier (number)

none

Creates an spheroid of a specified radius, stacks and sectors, stretched using the provided multiplier.

sphereoid 20 10 10 2


spheroidaxis

shapes and graphics

none

boolean

Returns the current spheroid axis, the axis along which spheroids are stretched. 0 is equatorial and 1 is polar.

show spheroidaxis


spheroidslice spds

shapes and graphics

radius (number) | stacks (number) | sectorstotal (number) | sectorsused (number) | multiplier (number)

none

Creates a partial spheroid of the overall specified radius, using the specified number of vertical ‘stacks’, and specified number of horizontal ‘sectors’, based on the given total number of sectors, and the used (displayed) number of sectors, and stretched using the provided multiplier. Like a squashed orange cut vertically. See cutspheroid, cutspheroidslice

spheroidslice 20 10 10 5 2


splitscreen ss

text

none

none

Displays the bottom 4 (in 24 line mode, 8 in 48 line mode, 2 in 12 line mode) lines of the text screen superimposed on the full graphics camera image. This is the default when turtleSpaces starts up. See fullscreen (no text), textscreen (only text), overlayscreen (full text overlaid on graphics)

splitscreen


spin

movement and vectors

[vectors] (list) | degrees

Spins the turtle around the given vector by the given number of degrees in a clockwise direction from behind the vector such that SPIN FORWARDDIR 90 would be the same as ROLLRIGHT 90. Does not affect pitch, heading or roll.

spin forwarddir 90


spot sp

shapes and graphics

radius (number)

none

Creates a filled circle of the specified radius.

spot 50


spotcutoff

turtles

none

number

Returns the spot cutoff value of the calling turtle, if that turtle is a light. See setspotcutoff

show spotcutoff


spotexp

turtles

none

number

Returns the spot exponent value of the calling turtle, if that turtle is a light. See setspotexp

show spotexp


sqrt

mathematics

number

number

Returns the square root of the provided number.

show sqrt 16
4


square sq

shapes and graphics

size (number)

none

Creates a filled square of the specified size.

square 20


squelch

sound and music

none

number

Returns the ‘squelch’ value, the volume level sounds under which are not played. See setsquelch

show squelch


srow

tables

table (word) | [row value (variance)] (list)

list

Searches a given row in the given table for the given value, within the optionally provided variance if numeric. See scol

show srow "table [4 6 2]


stamp

shapes and graphics

modelname (word)

none

‘Stamps’ a copy of the specified model at the current location using the current model scale.

cs pu repeat 20 [setmodelscale repcount / 10 stamp "plane fd 3 * repcount]


stack

environment

none

none

STACK shows the current stack at the terminal.

TYPE stack in interactive mode and you'll get:

2020/05/10 08:44:38 Stack trace:
2020/05/10 08:44:38 0 : frog (line 2, stmt 1): [stack]
2020/05/10 08:44:38 1 : __immediate.0 (line 1, stmt 1): [frog 20]

It's really to help us debug execution of instructions.


state

turtles

none

list

Returns a list containing the entire turtle state. See setstate

show state


startmark

shapes and graphics

none

none

Creates a half-oval “starting” mark. See mark, endmark

startmark


startrope

shapes and graphics

none

none

Creates a half-dome starting “cap” to a rope. See rope, endrope

startrope


stealth

movement and vectors

none

none

Causes the calling turtle not to appear in lists returned by near. See nostealth

stealth


stealthp

boolean

none

boolean

Returns true if the calling turtle is in stealth. See stealth, nostealth

show stealthp


step

environment

word or list

none

When procedures marked by the step primitive start execution, turtleSpaces pauses after execution of each statement.

CR processes next command and PRINTS it to text screen.

S resumes execution until thread leaves current scope (does not print debug during that time).

I executes until thread steps in to a scope.

O executes until the thread enters another TO, then pauses.

E executes until the thread exits a TO, then pauses

Q stops execution entirely

R resumes execution without stepping

N prompts for a "name and then shows the value of that name each step eg "name "value -- typing N and then entering an already monitored name disables monitoring that name. After doing an N STEP returns to the prompt without advancing

Use unstep to unmark procedures from stepping.


stickerp

boolean

none

boolean

Returns true if the specified sticker is defined. See newsticker

show stickerp


stickers

shapes and graphics

none

list

Returns the currently defined stickers. See newsticker

show stickers


stop

control

none

none

Stops execution inside the current procedure and returns to the level above, if it exists, or stops execution of the thread entirely.

stop


stopmusic

sound and music

none

none

Stops music playback. See playmusic

stopmusic


stopsound

sound and music

none

none

Stops any sounds currently being played by the calling turtle, including loopsound. See playsound, loopsound

stopsound


store

containers

database (name) | key (name) | container (name) OR [container1 container2…] (list)

none

Inserts or updates a record in a database with the key name. Store stores container names and their contents, which can be restored later using the retrieve primitive. See newdatabase, retrieve

newdatabase "farm
make "pigs 5 make "cows 2 make "ducks 12
store "farm "livestock [pigs cows ducks]


sum

mathematics

number1 (number) | number2 (number)

result (number)

Sums (adds) the two provided numbers.

show sum 2 2
4


surname

containers

none

namespace (word)

Returns the surname of the current container (name) space. The default surname is ‘default’. See setsurname.

print surname
default


suspend

control

worker (number) or workers (list)

none

Suspends execution of the specified worker(s). See resume, newworker

suspend 7


suspendp

boolean

workerid

boolean

Returns true if the specified worker is suspended. See suspend, resume

show suspendp 12


swap

containers

container1 (word) | container2 (word)

none

Exchanges the contents of two containers. Note that the name of the container is specified as a word, eg “container. See make

swap "container1 "container2


swapcolors

turtles

none

none

Exchanges the current pen and fill colors and shades.

swapcolors


switch

conditionals and flow

containername (word) or list

none

If the name of a container is given, switch sets up the specified container to be tested using subsequent case primitives. Note: the container name for switch is ‘absolute’, that is, prefaced with a double quote “. If you specify a container using a colon : the container used by switch will be the container named by the container specified with a colon! However, if a list is given, subsequent case statements will test against the first item in the list. Hence, you can use a ‘softlist’ to test against the value stored in a container or returned by a calculator.

switch "var
switch [testme donttestme]
switch {:var}


switchtag

shapes and graphics

tag1 (word) | tag2 (word)

none

Hides tag1 and shows tag2, like flipping a switch. See tag

switchtag "tag1 "tag2


sync

control

none

none

Causes turtle to wait until all other turtles in its ‘family’ (siblings, parents, hatchlings) also call sync, or if any of them call a nosync. Commonly used to synchronise multithreaded hordes of game objects, such as enemies. See syncp, nosync, marco

ht repeat 20 [hatch [forever [randomvectors fd 10 sync]]] forever [until syncp [wait 60] sync]


syncp

boolean

none

boolean

Returns true if the calling turtle’s ‘family’ currently has an active sync. See sync

if syncp [sync]


table

tables

name (word)

list

Returns the contents of the named table as a list.

show table "mytable


tables

tables

none

none

Returns a list of the currently defined tables.

show tables


tablesize

tables

name (word)

list

Returns a list of the dimensions of the named table.

show tablesize "mytable


tablep

boolean

name (word)

boolean

Returns true if the named table is defined.

show tablep "mytable


tag

shapes and graphics

name (word)

list

Returns the contents of a tag, as a list of turtle primitives. See begintag

show tag "mytag


tagp

boolean

tagname (word)

boolean

Returns true if the provided tag name is presently defined. See tag

show tagp "tag


tags

shapes and graphics

none

list

Returns a list of the current turtle’s defined tags.

show tags


tagshownp

boolean

tagname (word)

boolean

Returns true if the tag with the provided tagname is currently visible (shown). See tag

show tagshownp "tag


takecover

input and output

none

none

Takes a cover photo, which is displayed in the file catalog when a turtleSpace is selected. If no cover photo exists, the file catalog displays the most recent auto-created snapshot (created when save is called). See save

takecover


takesnapshot

input and output

none

none

Takes a snapshot (PNG image), and places it in the snapshots folder in the current turtleSpace.

takesnapshot


tan

mathematics

number

number

Returns the tangent of the supplied number. See arctan

print tan 5
0.087489


tandem

turtles

target (word)

none

keeps calling turtle in the same relative position (based on the orientation) of the target turtle as when tandem was called (for example, if the target moves, or rotates). If the calling turtle changes position using FD, etc., its relative position for the purposes of tandem is updated. tandem does not update the orientation of the calling turtle, only its position. notandem turns it off

tandem "myrtle


tandeming

turtles

none

turtle (word)

Returns the name of the turtle the calling turtle is tandeming, if any. See tandem

show tandeming


tandemp

boolean

none

boolean

Returns true if the calling turtle is tandeming another turtle. See tandem

show tandemp


target

turtles

turtle (word)

none

Causes the calling turtle to face the specified target turtle. A turtle may only target one turtle at a time. notarget turns it off. See notarget

target "myrtle


targeting

turtles

none

turtle (word)

Returns the name of the turtle the calling turtle is targeting, if any. See target

show targeting


targetp

boolean

none

boolean

Returns true if the calling turtle is targeting another turtle. See target

show targetp


tell

turtles

turtle (word) or turtles (list) | message (number, word or list)

none

Sends a message to the target turtle containing the provided number, word or list. See listen

tell snappy "hello


tent

shapes and graphics

half-width (number) | height (number) | depth (number)

none

Creates an opaque (solid) prism to the left, right and front of the turtle.

tent 10 10 5


test

conditionals and flow

expression

none

Evaluates the provided expression and then holds a boolean result for use with iftrue and iffalse.

test :a > 5


tether

movement and vectors

none

none

Tethers the selected turtle to the orbit anchor point. If the turtle moves, the anchor point remains unchanged. See setanchor, notether

tether


tetherp

boolean

none

boolean

Returns true if the calling turtle is tethering. See tether

show tetherp


tetrahedron th

shapes and graphics

size (number)

none

Creates a tetrahedron (4-sided shape) of the specified size.

tetrahedron 5


tetrahedroid tho

shapes and graphics

size (number) | ratio (number)

none

Creates a tetrahedroid (4-sided shape) of the specified size and stretched using the specified ratio.

tetrahedroid 5 2
tetrahedroid 10 0.5


text

environment

name (word)

list

Returns the contents of the provided procedure name as a list. See define

to square
repeat 4 [fd 10 rt 90]
end

show text "square
[[] [repeat 4 [fd 10 rt 90]]]


textbackground

text

none

number

Returns the current text background color. See settextbackground

show textbackground


textcolor

text

none

list

Returns the current text colors (foreground and background) as a list. See settextcolor

show textcolor


textfont

text

none

number

Returns the index of the current text font. See settextfont

show textfont


textforeground

text

none

number

Returns the current text foreground color. See settextforeground

show textforeground


textscreen ts

environment

none

none

Turns off the graphics rendering and displays only fullscreen text.

textscreen


textsize

text

none

number

Returns the current text size. See settextsize

show textsize


textshade

text

none

number

Returns the current textshade value.

show textshade


textwindow

text

none

list

Returns the current dimensions of the text window.

show textwindow


thing

containers

containername (word)

output

Returns the contents of (the ‘thing’ in) the container of the provided container name. A longhand way of invoking the shortcut :container

show thing in "mycontainer
make "mycontainer thing in "mycontainer + 5


third

words and lists

word, list or number

letter, word, list or number

Returns the third item in a word, list or number. Lists of three things (co-ordinates, vectors) are common in turtleSpaces and first, second, third are more elegant than item 1, item 2, item 3. If you want fourth, fifth etc, you can create your own procedures for them! That is the beauty of Logo. See also first, second

print third 345
5

print third [dog pig duck]
duck

print third "frog
o


throw

conditionals and flow

target (name)

none

Diverts execution to the first statement after the target catch statement. Chiefly useful for returning to the procedure / level the catch was called from when several levels deep into subprocedures or other procedures, as label / go only work inside the same procedure. Providing “toplevel as a target effectively halts execution, as toplevel is the interactive prompt. See also catch, label, go

TO test
catch "cow [duck]
pr "moo
END

TO duck
pr "quack
frog
END

TO frog
pr "ribbit
throw "cow
END


time

environment

none

milliseconds

Outputs the number of milliseconds since turtleSpace was started, or resettime was called. See resettime.

print time


title

input and output

none

title (word)

Returns the title (filename) of the current turtleSpace.

show title


to

name (:parameter1 :parameter2 …)

none

Declares that the user wishes to enter a procedure with the specified name. Can be optionally followed by any number of parameters, each starting with a colon. Each parameter must be specified when the procedure is executed, and these parameters become local containers (or variables) with the name of the parameter specified in the to, containing the value passed to the parameter when the procedure is executed. After return is pressed, the prompt turns into a > to indicate a procedure is being entered. Once you have entered the procedure, type end and press return to finish it. See edit

to square :size

repeat 4 [forward :size right 90]
end

square 40


toot tone

sound and music

frequency (number) | duration (number)

none

none

Toot generates a tone of the provided frequency (specified in Hertz) and duration (in 60ths of a second). The alias 'tone' is included for compatibility with other Logos.

to siren :freq
if :freq > 440 [stop]
toot :freq 3
siren :freq + 5
toot :freq 3
end


toroid tro

shapes and graphics

thickness (number) | radius (number) | sides (number) | segments (number) | ratio (number)

none

Creates a torusoid, an extruded three-dimensional ring, stretched by a ratio where 1 is a normal torus.

torus 10 30 4 16 0.5


toroidslice tros

shapes and graphics

thickness (number) | radius (number) | sides (number) | totalsegments (number) | startsides (number) | endsides (number) | ratio

none

Creates a ‘slice’ of a torus, based on the startsides and endsides value. Note that using a negative thickness value inverts the slice.

toroidslice 5 15 20 20 10 15 2
toroidslice -5 15 20 20 10 15 2


torusslice trs

shapes and graphics

thickness (number) | radius (number) | sides (number) | totalsegments (number) | startsides (number) | endsides (number)

none

Creates a ‘slice’ of a torus, based on the startsides and endsides value. Note that using a negative thickness value inverts the slice.

torusslice 5 15 20 20 10 15
torusslice -5 15 20 20 10 15


torus tr

shapes and graphics

thickness (number) | radius (number) | sides (number) | segments (number)

none

Creates a torus, also known as a rhombus or a donut, a three-dimensional ring. Sides and segments can be as low as 3.

torus 10 30 4 16


towards

movement and vectors

[x y] (list)

heading (number)

Returns a heading that would make the turtle face toward the provided co-ordinates. towards assumes the target co-ordinate is on the same Z plane as the turtle. towards is a legacy Apple Logo primitive that is useful in turtleSpaces for compatibility and two-dimensional applications. See heading

setheading towards [30 40]


trace

environment

list

none

The TRACE command takes a list of procedures as input and causes them to print tracing information when executed. It does not interrupt the execution of the procedure, but allows you to see the depth of the procedure in the stack. See untrace

trace [myproc]


track

shapes and graphics

none

none

Allows the calling turtle’s track to be created. See notrack

track


trackcount

shapes and graphics

none

number

Returns the number of items in the current turtle’s track.

show trackcount


trackitem

shapes and graphics

number

list

Returns the number last track item in the selected turtle’s track, where 1 returns the latest track entry

show trackitem 1


tracklist

shapes and graphics

number

list

Returns the last number latest track items in forward chronological order, the first being the oldest and the last being the newest and most recent.

show tracklist 5


tracker

sound and music

none

none

Opens the ‘tracker’, a music editor. turtleSpaces supports creation and playback of 6-channel waveform-generated music. See the help file available inside the tracker

tracker


trackp

boolean

none

boolean

Returns true if the calling turtle’s track is being generated / recorded. See track, notrack.

show trackp


trackrender

shapes and graphics

none

none

Causes the calling turtle’s ‘track’ to be rendered (updated) by the graphics renderer from the point it is called onwards. See notrackrender

trackrender


trailing

words and lists

number | word or list

word or list

Returns the specified number of trailing (ending) items in the provided word or list. See leading

print trailing 4 "teleport
port

show trailing 2 [dog cat pig frog]
[pig frog]


trackrenderp

boolean

none

boolean

Returns true if the calling turtle’s track is being rendered.

show trackrenderp


transcript

environment

none

none

Writes out a session file to disk containing text input, output and traces, in the current project folder. See notranscript

transcript


transcriptp

boolean

none

boolean

Returns true if transcript is enabled. See transcript, notranscript


traperect tre

shapes and graphics

width (turtle-units) | height | ratio

none

Creates a trapezoidal rectangle of the given width, height and with its far end contracted or expanded by the given ratio. See rect

traperect 50 50 2


trapevoxeloid tvo

shapes and graphics

width (turtle-units) | height | depth | ratio-W | ratio-D

none

Creates a trapezoidal voxel, whose far ‘end’ is affected by the given width and depth ratios.

trapevoxeloid 50 50 50 0.5 2


trapezoid tz

shapes and graphics

width (turtle-units) | height | ratio

none

Creates a quad whose far ‘end’ is expanded or contracted based on the provided ratio. See quad, skewtrapezoid

trapezoid 100 50 5


triangle tri

shapes and graphics

width (number) | height (number)

none

Creates a wireframe (pen-drawn) right-angle triangle to the front and right of the turtle.

triangle 10 20


true

boolean

none

true

Returns true. See false

show true


truncate

mathematics

number | decimalplaces (number)

number

Returns the input rounded to the specified number of decimal places.

print truncate 10.4325 2
10.43


try

conditionals and flow

list | list

none

Attempts to execute the instructions given in the first list, and if an error is encountered then executes the instructions in the second list. A one-off form of onerror. See onerror, throw, catch

try [repeat 10 [show 10 / (10 - repcount)]] [print |Divide by zero, silly!|]


tube tb

shapes and graphics

radius (number) | depth (number) | sides (number)

none

Creates a hollow tube.

tube 10 20 20


tubearc tba

shapes and graphics

thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number)

none

Creates a tube arc.

tubearc 5 15 20 20 10


tuboidarc tboa

shapes and graphics

thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | ratio (number)

none

Creates a tube arcoid (extruded based on the provided ratio).

tuboidarc 5 15 20 20 10 2


tubearcslice tbas

shapes and graphics

thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides (number)

Creates a slice of a partial tube. Note: If you invert the thickness value, you can ‘slice’ the opposite side.

tubearcslice 5 15 20 20 10 5 15


tubeslice tbs

shapes and graphics

radius (number) | depth (number) | sidestotal (number) | sidesused (number)

none

Creates a ‘slice’ of a tube, based on the sidestotal and sidesused values.

tubeslice 20 20 10 4


tuboid tbo

shapes and graphics

radius (number) | depth (number) | sides (number) | ratio (number)

none

Creates a tuboid, or stretched tube.

tuboid 10 20 20 0.5


tuboidarc tboa

shapes and graphics

thickness (number) | radius (number) | sides (number) | totalsegments (number) | arcsegments (number) | ratio (number)

none

Creates a tube arc extruded by the provided ratio.

tuboidarc 5 15 20 20 10 2


tuboidarcslice tboas

shapes and graphics

thickness (number) | radius (number) | totalsides (number) | totalsegments (number) | arcsegments (number) | startsides (number) | endsides | ratio (number)

none

Creates a tube arc sliced by the provided sides values and extruded by the provided ratio.

tuboidarcslice 5 15 20 20 10 10 15 2


tuboidslice tbos

shapes and graphics

radius (number) | depth (number) | sidestotal (number) | sidesused (number) | ratio (number)

none

Creates a stretched ‘slice’ of a tube, based on the sidestotal and sidesused values, and the stretching ratio (normal is 1, half is 0.5, double is 2 etc.)

tuboidslice 10 20 20 10 0.5
tuboidslice 10 20 20 10 2


turtle

turtles

none

turtlename (word)

Returns the current turtle. See setturtle

show turtle
myrtle


turtles

turtles

none

turtlenames (list)

Lists the currently defined turtles.

show turtles
[myrtle libby snappy]


twosided tws

shapes and graphics

none

none

Lights both sides of the surface of a shape. Useful for shapes where both sides of the surface are visible. The default is that they are unlit. Whether to use twosided or not is a purely stylistic choice in most cases. See notwosided, which turns twosided off.

twosided


type

text

word, number or [list]

none

Outputs the specified data to the screen without following it by a carriage return. See print, show

type "frog type "pig
frogpig


typeset

shapes and graphics

word or [list]

Typeset renders the provided word or list as three-dimensional text to the right of the turtle one character at a time, moving the turtle to the right as it does so.

typeset [Welcome to turtlespaces!]

typeset {[Happy New Year] year [!]}


typedepth

shapes and graphics

none

depth (number)

Returns the current depth of text rendered using typeset. See typeset

show typedepth


typefont

shapes and graphics

none

font (number)

Returns the index of the font used by typeset. See typeset

show typefont


typesize

shapes and graphics

none

size (number)

Returns the size of the text rendered by typeset. See typeset.

show typesize


typestretch

shapes and graphics

none

size (number)

Returns the ratio by which text rendered by typeset will be stretched. See typeset.

show typestretch


unbury

environment

name or list

none

Unburies the named procedures. See bury.

unbury "myproc


unburyall

environment

none

none

Unburies all procedures and containers currently buried in the workspace. See bury

unburyall


unburyname

containers

word or list

none

Unburies the container(s) named in its input. See bury

unburyname "container


undo

input and output

none

none

turtleSpaces autosaves any additions or changes to its current library of procedures. To revert to the previous autosave, use undo. To then revert to the next autosave (the one you were previously at) use redo. Note: if you add or change any procedures while in the autosave ‘chain’, the new autosave will be at the end of the chain, and you will need to undo back from the end to return to the state you were at prior to making the change. See redo

undo


unique

words and lists

list

none

Returns only the unique elements of a list.

show unique [pig frog frog duck]
[pig frog duck]


unplot

shapes and graphics

co-ordinates [list]

none

‘Unplots’ or removes the pixel / voxel from the selected plot at the provided co-ordinates. The list of coordinates may contain two or three numbers, depending on if the selected plot is two- or three-dimensional. See plot

unplot [10 10]
unplot [20 10 10]


unshare

containers

name (word) or names (list)

none

Unlike eraseshare which erases the share and its container, unshare changes the share back into a ‘global’ (turtle-internal) container.

unshare "container


unstep

environment

word or list

none

Unmarks the named procedure or procedures from stepping. See step

unstep "procedure


until

conditionals and flow

comparison [list of requests]

none

Repeats the list of requests until the comparison is true.

make "count 1 until :count = 20 [inc "count]


untrace

environment

list

none

Stops tracing the specified procedures.

untrace [myproc]


up

movement and vectors

degrees

none

Angles the ‘nose’ of the turtle up the specified number of degrees. If looking down at the turtle from above (the default view), up 90 will cause the turtle to point straight up towards you.

up 90


updir

movement and vectors

none

vector (list)

Returns the calling turtle’s current up vector. See rightdir, forwarddir

show updir


unproject

movement and vectors

position (list)

[x-percent y-percent (list)

Returns the 2D position of the object as a percentage of the window / screen. For example, if the turtle appears to be in the dead center of the screen, unproject will return 50% across and 50% down. Note: If the co-ordinate is not in the view of the camera, unproject will return spurious results!

unproject myrtle:position


uppercase

words and lists

word

word

Converts word to UPPERCASE.

print uppercase "i\ like\ to\ shout!
I LIKE TO SHOUT!


user

environment

none

word

Returns the name of the current user.

print user


userp

boolean

name (word)

boolean

Returns true if the provided name is a currently defined user.

show userp "Bonnie
true


users

environment

none

list

Returns a list of the defined users.

print users


vectoradd

mathematics

vector (list) | vector (list)

list

Add two vectors giving a new vector.

vectoradd [0 1 0] [1 0 1]
[1 1 1]


vectorcross

mathematics

vector (list) | vector (list)

list

Returns vector perpendicular to the two provided vectors.

show vectorcross [0 .2 0] [0 0.5 0.5]
[0.1 0 0]


vectordot

mathematics

vector (list) | vector (list)

number

Returns the “dot” product of two vectors.

show vectordot [0 0.12 0.12] [0.5 0 0.5]
0.06


vectornormal

mathematics

vector (list)

list

Returns a “normal” vector of length 1.

show vectornormal [20 20 20]
[0.5773502691896257 0.5773502691896257 0.5773502691896257]


vectormultiply

mathematics

vector (list) | amount (number)

list

Multiply vector by given amount.

show vectormultiply [0.5 0.5 0.5] 2
[1 1 1]


vectors

movement and vectors

none

[forwarddir updir rightdir]

Returns the orientation vectors of the turtle as a list. This is the most reliable method of storing and restoring the orientation of a turtle, as opposed to the orientation function, which returns relative heading / pitch / roll values.

print vectors


vectorsub

mathematics

vector1 (list) | vector2 (list)

list

Subtract vector1 from vector2, giving a new vector.

show vectorsub [0 1 0] [1 0 1]
[1 -1 1]


view

environment

word or list

none

Opens the editor with the output provided to view.

view table "table
view workers


viewfar

shapes and graphics

none

turtle-units (number)

Returns the value of the far clipping plane. See setviewfar

show viewfar


viewfov

shapes and graphics

none

angle (number)

Returns the current viewing angle, or field of view. See setviewfov

show viewfov


viewhelp

environment

none

none

Opens the help file in the viewer. You can use the cursor keys to scroll through it. shift + up and down scroll through it faster!

viewhelp


viewnear

shapes and graphics

none

turtle-units (number)

Returns the current near clipping plane. See setviewnear

show viewnear


viewref

environment

none

none

Opens the primitive reference file in the viewer. You can use the cursor keys to scroll through it, or control-shift-W to search for a particular primitive. shift + up and down scroll through it faster! You can open the reference faster using control-shift-R. See help

viewref


viewturtle

turtles

none

word

Returns the current view turtle

show viewturtle
"snappy


viewturtlep

boolean

name (word)

boolean

Returns true if the named turtle is currently the view turtle.

show viewturtlep "snappy
true


viewvectors

shapes and graphics

none

list

Returns the calling turtle’s view vectors. See setviewvectors

show viewvectors


visiblep

boolean

none

boolean

Returns true if the calling turtle is in view of the current view turtle

show visiblep


volume

sound and music

none

number

Returns the current ‘master’ volume.

show volume


vowelp

boolean

character

boolean

Returns true if the provided character is a vowel (a e i o u or y)

show vowelp "u


voxel vx

shapes and graphics

turtle-steps

none

Creates a filled cube turtle-steps wide, high and deep to the right, forward and down of the turtle.

voxel 20


voxeloid vxo

shapes and graphics

turtle-steps-right turtle-steps-forward turtle-steps-deep

none

Creates a filled cuboid to the right, forward and down of the turtle.

voxeloid 10 20 30


wait

control

60ths-of-a-second (number)

none

Pauses execution for the amount of time specified in 60ths of a second. wait 60 pauses for one second.

wait 60


webtext

environment

none

none

Only works in webLogo. Causes an 80×24 character text area to appear in the editor location. nowebtext restores the editor. This can be output (print, show, setcursor etc) to by first calling setwrite “webtext — see setwrite, nowebtext

webtext setwrite "webtext


wedge

shapes and graphics

turtle-steps-right turtle-steps-forward

Creates a filled right-angle triangle turtle-steps-right from the turtle and turtle-steps-forward from the turtle in dimensions.

wedge 20 4


when

conditionals and flow

comparison [requests]

none

Waits until the comparison is true, then executes the provided requests. This blocks execution; it is not a trigger. To use it as such, use newworker eg newworker [when minutes = 0 [toot 1000 60]]

when minutes = 0 [toot 1000 60]


whichsector

environment

none

list

Returns a list indicating the calling turtle’s currently inhabited sector, based on the selected zone. See selectzone, putsector

show whichsector


whichzones

environment

none

list

Returns a list of the zones the turtle is currently inside of. See zones, newzone

show whichzones


while

conditionals and flow

comparison [instructions]

none

While the provided comparison is true, the supplied instructions will be repeatedly executed.

while 😡 < 10 [make "x 😡 + 1 print :x]


width

text

none

number

Returns the width of the text screen.

show width


window

turtles

none

none

Sets ‘window’ mode, in which the turtle is unrestricted and can leave the area defined by bounds. See fence, wrap

window


windowp

boolean

none

boolean

Returns true if the turtle is currently in ‘window’ mode. See window

show windowp


windowpos

environment

none

list

Returns the absolute screen position of the top-left corner of the turtleSpaces window. See windowsize, displaysize

show windowpos


windowsize

environment

none

list

Returns the size of the turtleSpaces window in pixels. See windowpos, displaysize


withinp

boolean

number or list | number or list | number of list

boolean

Compares two lists or numbers, returns true if they are within the variance specified by the third list of container. All three lists need to have the same number of parameters. Used mainly for comparing position / proximity of turtles.

show withinp [10 10 10] [15 15 15] [10 10 10]
true

show withinp 5 8 2
false


without

words and lists

word | word or list

word or list

Removes all instances of the specified word in the specified word or list and returns the result.

show without "pig [dog cow pig]
[dog cow]

show without "pig "dogcowpig
"dogcow


wrap

turtles

none

none

Sets the turtle in wrap mode, which means if the turtle reaches the edge of the area defined by setbounds, it wraps to the opposite side of that area. See window, fence.

wrap


wrapp

boolean

none

boolean

Returns true if the turtle is currently in ‘wrap’ mode. See wrap, window, fence

show wrapp


word

words and lists

word or list | word or list

word

Combines its inputs into a single word, without spaces between them. word takes two inputs, unless enclosed in round brackets (). To combine multiple inputs into a word with spaces, see longword. To combine multiple inputs into a list, see sentence

show word "frog "duck
frogduck

show (word "one "two "three)
onetwothree

show (word [pig duck chicken])
pigduckchicken


wordp

boolean

none

boolean

Returns true if the input is a word.

show wordp "word


writepos

input and output

none

bytes (number)

Returns the current write position in bytes.

show writepos


writer

input and output

none

filename (word)

Returns the name of the file currently open for writing.

show writer


workerp

control

id-number

boolean

Returns true if worker with id-number is running.

print workerp 123


workers

control

none

list

Returns a list of running workers.

show workers


xcor xpos

movement and vectors

none

xpos (number)

Returns the current x co-ordinate of the turtle.

show xpos


ycor ypos

movement and vectors

none

ypos (number)

Returns the current y co-ordinate of the turtle.

show ypos


year

environment

none

Returns the current year.

print year

2020


zcor zpos

movement and vectors

none

zpos (number)

Returns the current z co-ordinate of the turtle.

show zpos


zeroheading

movement and vectors

none

none

Zeroes the turtle’s heading value. This does not modify the turtle’s orientation. Further changes will modify heading as appropriate. This primitive allows you to establish a new base heading value to work forward from. See heading

zeroheading


zeroorientation

movement and vectors

none

none

Zeroes the turtle’s orientation values (pitch, heading, roll). This does not modify the turtle’s actual orientation. Further changes will modify orientation values as appropriate. This primitive allows you to establish new base orientation values to work forward from. See orientation

zeroorientation


zeropitch

movement and vectors

none

none

Zeroes the turtle’s pitch value. This does not modify the turtle’s orientation. Further changes will modify pitch as appropriate. This primitive allows you to establish a new base pitch value to work forward from. See pitch

zeropitch


zeroroll

movement and vectors

none

none

Zeroes the turtle’s roll value. This does not modify the turtle’s orientation. Further changes will modify roll as appropriate. This primitive allows you to establish a new base roll value to work forward from. See roll

zeroroll


zones

environment

none

list

Returns a list of all zones defined in the current space.

show zones


zoom

movement and vectors

none

number

Returns the turtle’s ‘zoom’ value, which is relevant to its display when it is a view turtle. 100 (as in 100%) is the default value. See setzoom

show zoom