turtles


ambient

turtles

none

list

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

show ambient


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


arrowsize

turtles

none

size

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

show arrowsize


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


cam

turtles

none

none

Returns the current camera (view) turtle.

cam:forward 20


cloneturtle

turtles

sourceturtle (word) | destinationturtle (word)

none

Clones a turtle.

cloneturtle "myrtle "max


copydef

turtles

sourceprocedure (word) | procedurecopy (word)

none

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

copydef "procedure "procedurecopy


copyproc

turtles

procedure (word) | target (word)

none

Copies a procedure from the calling turtle to the target turtle

copyproc "procedure "turtle


diffuse

turtles

none

list

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

show diffuse


drain

turtles

none

none

Empties the calling turtle’s message queue.

drain


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


fluidinterval

turtles

none

number

Returns the number of milliseconds fluid waits between steps and angle movements. See setfluidinterval

show fluidinterval


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


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


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


hideall

turtles

none

none

Hides all turtles. See showall

hideall


hideturtle ht

turtles

none

none

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

hideturtle


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


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


markerwidth

turtles

none

turtle-units (number)

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

show markerwidth
2


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


models

turtles

none

list

Returns a list of the currently defined models.

show models
[myrtle turtle]


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


nameturtle

turtles

name (word)

none

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

nameturtle "fred


newturtle newtu

turtles

name (word)

none

Creates a new turtle with the given name. The turtle is hidden by default, and is hidden when reset is called.

newturtle "daisy


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


popturtle popt

turtles

none

none

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

popturtle


procs

turtles

none

list

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

show procs


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


query

turtles

turtle (word) | query (list)

result

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

show query "snappy [position]


release

turtles

none

none

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

release


renameturtle

turtles

oldname | newname

none

Renames a turtle.

renameturtle "fred "doug


saveturtle

turtles

filename

none

Saves the calling turtle’s procedures to a file.

saveturtle


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]


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


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]


setfluidangle

turtles

angle (number)

none

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

setfluidangle 5


setfluidinterval

turtles

number

none

Sets the number of milliseconds fluid waits between steps and angle movements. See fluidinterval

show setfluidinterval


setfluidstep

turtles

steps (number)

none

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

setfluidstep 1


sethatchlimit

turtles

number

none

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

sethatchlimit 100


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


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


setmodelscale

turtles

ratio (number)

none

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

setmodelscale 2


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]


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


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


setstate

turtles

state (list)

none

Sets the turtle’s state. See state

setstate snappy:state


setturtle tu

turtles

turtlename (word)

none

Sets the turtle to execute as to the provided turtlename. Shortcut is tu

setturtle myrtle
tu snappy


showall

turtles

none

none

Shows all turtles. See hideall

showall


showarrow

turtles

none

none

Shows the directional arrow, which indicates the direction the turtle is facing. See hidearrow, setarrowsize, setarrowdistance

showarrow


showturtle st

turtles

none

Causes the turtle to display if hidden.

showturtle


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


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


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


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


state

turtles

none

list

Returns a list containing the entire turtle state. See setstate

show state


swapcolors

turtles

none

none

Exchanges the current pen and fill colors and shades.

swapcolors


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


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


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


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]


updatestate

turtles

none

none

Updates the state of the calling turtle. Only useful if the turtle’s rendering is currently disabled, either by notrackrender or norender. In a no-render state, the turtle’s position and orientation information is otherwise not updated unless updatestate is called (as these are updated by the processing of the ‘turtle track’).

updatestate


viewturtle

turtles

none

word

Returns the current view turtle

show viewturtle
"snappy


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


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