environment
about
environment
none
word
About returns the description of the current turtleSpace. See setabout
show about
This is my turtleSpace
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
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
backgroundshade
environment
none
number
Returns the background shade. See setbackgroundshade
show backgroundshade
blocks
environment
none
none
Turns on ‘blocks’ mode (in development, mostly broken)
blocks
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
camcontrol
enviroment
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
clearhistory
environment
none
none
Clears the interactive prompt’s history.
clearhistory
clearsector
environment
none
none
Clears the name / value pairs (keys) out of the current sector. See zone
clearsector
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
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]
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
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]]]
deletespace
environment
word
none
Removes the space of the given name.
deletespace "myspace
displaysize
environment
none
list
Returns the size of the display currently displaying the turtleSpaces window. See windowpos, windowsize, setwindowpos, setwindowsize
show displaysize
dragselect
environment
none
none
Allows text to be selected and copied to the clipboard by clicking and dragging. See nodragselect
dragselect
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
end
environment
none
none
Closes a ‘to’, a procedure definition. See to
end
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
erasekey
environment
keyname (word)
none
Erases the provided key from the current sector, if that key exists. See zones
erasekey “key
eraseprocs erps
environment
none
none
Erases all procs in the calling turtle. To erase all procs in all turtles see initialize
eraseprocs
error
environment
none
sentence
Returns the text of the last error.
show error
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
help
environment
primitivename (word)
none
displays the help entry for the provided primitive name. See viewhelp
help "forward
hideanchor
environment
none
none
Hides the turtle’s anchor from view. See showanchor, anchor
hideanchor
hidemouse
environment
none
none
Hides the mouse cursor. See showmouse
hidemouse
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
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
initialize
environment
none
none
Re-initializes the turtleSpaces environment. Clears the workspace and resets all the turtle states. Similar to restart.
initialize
keyclick
environment
none
none
Causes keypresses to make various beeping noises. See nokeyclick
keyclick
lastrem
environment
none
word or list
Returns the last (executed) ‘remark’ made using rem. See rem
show lastrem
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
listzones
environment
none
none
Prints out the currently defined zones in the Space occupied by the calling turtle.
listzones
maximize
environment
none
none
Maximizes (makes full-screen) the turtleSpaces window. See restore (which restores it)
maximize
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
modelp
environment
word
boolean
Returns true if there is a model with the name of the provided word.
show modelp "turtle
true
month
environment
none
month (number)
Returns the current month.
show month
8
newspace
environment
name (word)
none
Creates a new space with the specified name.
newspace "myspace
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]
noapi
environment
none
none
Disables incoming API connectivity. See api
noapi
noblocks
environment
none
none
Disables blocks mode
noblocks
nocamcontrol
environment
none
none
Disables ‘camcontrol’ mode
nocamcontrol
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
nokeyclick
environment
none
none
Disables keyclick if enabled. See keyclick
nokeyclick
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
nostep
environment
none
none
Cancels all steps. See step
nostep
notrace
environment
none
none
Cancels all traces. See trace
notrace
notranscript
environment
none
none
Disables transcript, if enabled. See transcript
notranscript
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!]
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
paper
environment
none
none
Enables ‘paper’ (white) mode. nopaper turns it off.
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
pops
environment
none
none
Prints all of the calling turtle’s procedures to the screen.
pops
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
primitives
environment
none
list
Returns a list of all available primitives (also known as primitives).
show primitives
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
randombackgroundcolor randbg
environment
none
none
Selects a random background color (0 – 15). See setbackgroundcolor
repeat 50 [randbg] setbg 0
randombackgroundshade randbs
environment
none
none
Selects a random background shade (0-15). See setbackgroundshade
randbs
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
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
renameproc
environment
source | destination
none
Renames a procedure.
renameproc "oldname "newname
render
environment
none
none
Enables global (all turtles) rendering of 3D graphics. See norender, which turns it off.
render
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
resetspace
environment
none
none
Resets only the turtles in the current space, and space-specific parameters such as the background color.
resetspace
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
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
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
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!|
setbackgroundcolor setbg
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
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
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
showanchor
environment
none
none
Shows the location of the turtle’s anchor with a red ball. See hideanchor, anchor
showanchor
showmouse
environment
none
none
Shows the mouse cursor. See hidemouse
showmouse
shutdown
environment
none
none
Shuts down turtleSpaces.
shutdown
space
environment
none
word
Returns the current space.
show space
spaces
environment
none
list
Returns a list of the currently defined spaces
show spaces
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.
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]]]
textscreen ts
environment
none
none
Turns off the graphics rendering and displays only fullscreen text.
textscreen
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]
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
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
unstep
environment
word or list
none
Unmarks the named procedure or procedures from stepping. See step
unstep "procedure
untrace
environment
list
none
Stops tracing the specified procedures.
untrace [myproc]
user
environment
none
word
Returns the name of the current user.
print user
users
environment
none
list
Returns a list of the defined users.
print users
view
environment
word or list
none
Opens the editor with the output provided to view.
view table "table
view workers
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
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
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
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
zones
environment
none
list
Returns a list of all zones defined in the current space.
show zones