Référence › Environment — 164 commandes


about

environment

Entrée: none
Sortie: word

About returns the description of the current turtleSpace. See setabout

show about
This is my turtleSpace

addto

environment

Entrée: procedurename
Sortie: none

Continues line-entry mode of an existing procedure.

addto "existingprocedure

advancerandom

environment

Entrée: number
Sortie: none

Advances the current random number generator by the given number of random numbers. See setrandom, rerandom, reseed

advancerandom 10

api

environment

Entrée: none
Sortie: 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

aspect

environment

Entrée: none
Sortie: ratio

Returns the current canvas aspect ratio. Default is 1.78 (16:9)

show aspect

assemble

environment

Entrée: procedure (word)
Sortie: 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

blocks

environment

Entrée: none
Sortie: none

Turns on 'blocks' mode (in development, mostly broken)

blocks

bury

environment

Entrée: procedure or [procedures]
Sortie: 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

Entrée: none
Sortie: none

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

buryall

camcontrol

environment

Entrée: none
Sortie: 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

Entrée: none
Sortie: none

Clears the interactive prompt's history.

clearhistory

clearsector

environment

Entrée: none
Sortie: none

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

clearsector

clearuser

environment

Entrée: none
Sortie: none

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

clearuser

clearzones

environment

Entrée: none
Sortie: none

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

clearzones

createuser

environment

Entrée: name (word)
Sortie: none

Creates a new user with the specified name.

createuser "Bonnie

creators

environment

Entrée: list
Sortie: 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

Entrée: none
Sortie: number

Returns the current day of the month.

show day
22

debug

environment

Entrée: none
Sortie: 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

Entrée: procedurename (word) | procedure (list)
Sortie: none

define creates a new procedure of the given tename 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

Entrée: word
Sortie: none

Removes the space of the given name.

deletespace "myspace

displaysize

environment

Entrée: none
Sortie: list

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

show displaysize

dragselect

environment

Entrée: none
Sortie: none

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

dragselect

edit

environment

Entrée: procedure (word)
Sortie: none

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

edit "bananas

end

environment

Entrée: none
Sortie: none

Closes a 'to', a procedure definition. See to

end

erall

environment

Entrée: none
Sortie: none

Erases all procedures, variables and properties from the workspace.

erall

erase

environment

Entrée: procedure (word)
Sortie: none

Erases the specified procedure from the calling turtle's workspace

erase "myprocedure

erasekey

environment

Entrée: keyname (word)
Sortie: none

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

erasekey “key

eraseprocs

Aussi: erps

environment

Entrée: none
Sortie: none

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

eraseprocs

error

environment

Entrée: none
Sortie: sentence

Returns the text of the last error.

show error

flag

environment

Entrée: none
Sortie: none

Executes Myrtle's flag trigger using the main (archon) worker, and other turtle's flag triggers in new workers. Same as pushing the flag button in the web interface, but can be done programmatically, which is useful in the desktop client. Re-enables all other triggers.

flag

frameinterval

environment

Entrée: none
Sortie: 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

Aussi: [fs]

environment

Entrée: none
Sortie: 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

Entrée: primitivename (word)
Sortie: none

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

help "forward

hideanchor

environment

Entrée: none
Sortie: none

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

hideanchor

hidearrow

environment

Entrée: none
Sortie: none

Hides the turtle's directional arrow. See showarrow

hidearrow

hideaxes

environment

Entrée: none
Sortie: none

Causes axes not to be displayed which hilight co-ordinate directions in turtleSpaces. See showaxes

hideaxes

hidemouse

environment

Entrée: none
Sortie: none

Hides the mouse cursor. See showmouse

hidemouse

historycount

environment

Entrée: none
Sortie: number

Returns the number of items in the interactive history.

show historycount

historyitem

environment

Entrée: number
Sortie: 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

Entrée: number
Sortie: 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

hours

environment

Entrée: none
Sortie: number

Returns the current hour in 24 hour time.

print hours

ignore

environment

Entrée: input
Sortie: 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

Entrée: none
Sortie: none

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

initialize

lastrem

environment

Entrée: none
Sortie: word or list

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

show lastrem

listprimitives

environment

Entrée: none
Sortie: none

Prints a list of all built-in primitives.

listprimitives

listprocs

environment

Entrée: none
Sortie: none

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

listprocs

listspaces

environment

Entrée: none
Sortie: none

Prints a table of the currently defined spaces and the turtles occupying each one. See spaces

listspaces

listzones

environment

Entrée: none
Sortie: none

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

listzones

maximize

environment

Entrée: none
Sortie: none

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

maximize

minutes

environment

Entrée: none
Sortie: number

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

print minutes
10

model

environment

Entrée: none
Sortie: word

Returns the name of the currently selected model.

print model

modelp

environment

Entrée: word
Sortie: boolean

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

show modelp "turtle

month

environment

Entrée: none
Sortie: month (number)

Returns the current month.

show month
8

setbuttonimages

environment

Entrée: "name [image (clickimage) (hoverimage)]
Sortie: none

Sets the image skin of the existing button named name. The list holds up to three image references: the normal face, an optional pressed face, and an optional hover face. Each reference can be the name of a loaded image (see loadimage), the name of a workspace image resource, or a direct URL (wrap URLs in pipes, eg |https://…|). When shown, an image replaces the button's text face unless the button was given an explicit label. Passing an empty list [] clears all three images and returns the button to text rendering. Errors if no button of that name exists. See newbutton, showbutton, hidebutton, buttonclickedp, loadimage

loadimage "launch |https://example.com/launch.png|
setbuttonimages "go [launch]

newspace

environment

Entrée: name (word)
Sortie: none

Creates a new space with the specified name.

newspace "myspace

newzone

environment

Entrée: name (word) | [x y z] (list) | [x y z] (list)
Sortie: 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

Entrée: none
Sortie: none

Disables incoming API connectivity. See api

noapi

noblocks

environment

Entrée: none
Sortie: none

Disables blocks mode

noblocks

nocamcontrol

environment

Entrée: none
Sortie: none

Disables 'camcontrol' mode

nocamcontrol

nodebug

environment

Entrée: none
Sortie: none

Disables debug. See debug

nodebug

nodes

environment

Entrée: none
Sortie: 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

Entrée: none
Sortie: none

Disables dragselect. See dragselect

nodragselect

nopaging

environment

Entrée: none
Sortie: none

Disables paging. See paging

nopaging

nopaper

environment

Entrée: none
Sortie: none

Disables paper. See paper

nopaper

nosandbox

environment

Entrée: none
Sortie: 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

noshader

environment

Entrée: none
Sortie: none

Disables the WebGL shader. See shader

noshader

nostep

environment

Entrée: none
Sortie: none

Cancels all steps. See step

nostep

notrace

environment

Entrée: none
Sortie: none

Cancels all traces. See trace

notrace

notranscript

environment

Entrée: none
Sortie: none

Disables transcript, if enabled. See transcript

notranscript

noxray

environment

Entrée: none
Sortie: none

Disables xray. See xray

noxray

paging

environment

Entrée: none
Sortie: 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

Entrée: none
Sortie: none

Enables 'paper' (white) mode. nopaper turns it off.


po

environment

Entrée: name or names (word or list)
Sortie: none

Prints out the specified procedure or procedures to the screen.

po "procedure
po [procedure1 procedure2]

poall

environment

Entrée: none
Sortie: none

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

poall

pops

environment

Entrée: none
Sortie: none

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

pops

pot

environment

Entrée: procedure name or names (word or list)
Sortie: 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

Entrée: none
Sortie: none

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

pots

primitives

environment

Entrée: none
Sortie: list

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

show primitives

projectid

environment

Entrée: none
Sortie: number

Returns the ID of the current project.

show projectid

publishedid

environment

Entrée: none
Sortie: number

Returns the published id of the current project or 0 if unpublished


putsector

Aussi: setsector

environment

Entrée: name (word) | value
Sortie: 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

randomseed

environment

Entrée: none
Sortie: number

Returns the current random seed value, for the currently selected random number generator. See setrandomseed, setrandom

show randomseed

recycle

environment

Entrée: none
Sortie: 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

Entrée: key (word)
Sortie: 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

Entrée: sector (list) | container (word)
Sortie: 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

Entrée: position (list) | container (word)
Sortie: 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

rem

environment

Entrée: list
Sortie: 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}

redraw

environment

Entrée: none
Sortie: none

Forces a refresh of the graphical environment to ensure transparent objects are rendered after opaque ones. See also redrawtrack

redraw

redrawtrack

environment

Entrée: none
Sortie: none

Forces a refresh of the calling turtle's 'turtle track', to ensure transparent objects are rendered after opaque ones. See also redraw

redrawtrack

renameproc

environment

Entrée: source | destination
Sortie: none

Renames a procedure.

renameproc "oldname "newname

render

environment

Entrée: none
Sortie: none

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

render

rerandom

environment

Entrée: none
Sortie: none

Resets the calling turtle's random number generator to the state 'seeded' at the point the turtle was created or re-created. This causes a replication of the series of numbers generated by random.

rerandom

reseed

environment

Entrée: none
Sortie: none

Causes the calling turtle's random number generator to be reseeded using current time values. This encourages variety from the random number generator. See random and rerandom

reseed

reset

environment

Entrée: none
Sortie: none

Clears the environment (excluding frozen tracks and those created by system turtles, if reset is not called by a system turtle), erases all containers, halts all workers, returns all turtles to their home positions in all spaces. See resetspace, clearfrozen

reset

resetall

environment

Entrée: none
Sortie: none

Same as reset, resettext, cleartext, resettime and clearallfrozen. Does not affect freezes or terrains created by system turtles unless called by a system turtle.

resetall

resetspace

environment

Entrée: none
Sortie: none

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

resetspace

resettime

environment

Entrée: none
Sortie: none

Resets the system timer to zero.

resettime

restart

environment

Entrée: none
Sortie: none

Restarts turtleSpaces.

restart

restore

environment

Entrée: none
Sortie: none

Restores a maximized window. See maximize

restore

sandbox

environment

Entrée: [primitive1 primitive2…]
Sortie: 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]

seconds

environment

Entrée: none
Sortie: seconds (number)

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

show seconds

sectorkeys

environment

Entrée: none
Sortie: list

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

show sectorkeys

selectspace

environment

Entrée: space (word)
Sortie: 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

Entrée: name (word)
Sortie: none

Selects the specified user as the current operating user.

selectuser "Bonnie

selectzone

environment

Entrée: name (word)
Sortie: none

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

selectzone "zone

setabout

environment

Entrée: word
Sortie: 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!|

setaspect

environment

Entrée: number
Sortie: none

Sets the canvas aspect ratio. The default is 1.78 (16:9). 1 is square.

setaspect 1

setbackgroundshade

Aussi: setbs sbs

environment

Entrée: shade (number)
Sortie: 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

setframeinterval

environment

Entrée: milliseconds
Sortie: none

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

setframeinterval 200

setrandom

environment

Entrée: number
Sortie: none

Selects the random number generator used by the various random primitives. Default is 1. Useful with rerandom to utilize multiple streams of random numbers.

setrandom 1

setrandomseed

environment

Entrée: number
Sortie: none

Sets the random seed used by the currently selected random number generator. See randomseed, setrandom

setrandomseed 100

setsectorindex

environment

Entrée: sector (list) | container (word) | value
Sortie: 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

Entrée: position (list) | container (word) | value
Sortie: 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

setwindowpos

environment

Entrée: [x y] (list)
Sortie: none

Positions the turtleSpaces application window given the specified x and y (top-left) co-ordinates.

setwindowpos [50 50]

setwindowsize

environment

Entrée: size (y)
Sortie: 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

shader

environment

Entrée: none
Sortie: none

Enables the WebGL 'shader', which applies effects to the displayed graphical output. See noshader, setshadertype, setshadersettings

shader

shaderp

environment

Entrée: none
Sortie: boolean

Returns true if shader is enabled. See shader, noshader

show shaderp
true

showanchor

environment

Entrée: none
Sortie: none

Shows the location of the turtle's anchor with a red ball. See hideanchor, anchor

showanchor

showaxes

environment

Entrée: none
Sortie: none

Causes axes to be displayed which hilight co-ordinate directions in turtleSpaces. See hideaxes

showaxes

showmouse

environment

Entrée: none
Sortie: none

Shows the mouse cursor. See hidemouse

showmouse

shutdown

environment

Entrée: none
Sortie: none

Shuts down turtleSpaces.

shutdown

space

environment

Entrée: none
Sortie: word

Returns the current space.

show space

spaces

environment

Entrée: none
Sortie: list

Returns a list of the currently defined spaces

show spaces

stack

environment

Entrée: none
Sortie: 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.

step

environment

Entrée: word or list
Sortie: none

When procedures marked by the step primitive start execution, turtleSpaces pauses after execution of each statement.

S resumes execution until thread leaves current scope (does not print debug during that time).

CR processes next command and PRINTS it to text screen.
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

Entrée: name (word)
Sortie: 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

Aussi: ts

environment

Entrée: none
Sortie: none

Turns off the graphics rendering and displays only fullscreen text.

textscreen

tidy

environment

Entrée: procedure (word) | width (number)
Sortie: none

Reformats the specified procedure to the given width, separating nested commands out on to separate lines and doing other things to make your code look tidy

tidy "myproc 40

time

environment

Entrée: none
Sortie: milliseconds

Outputs the number of milliseconds since turtleSpace was started, or resettime was called. See resettime.

print time

to

environment

Entrée: name (:parameter1 :parameter2 …)
Sortie: 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

trace

environment

Entrée: list
Sortie: 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

Entrée: none
Sortie: none

Writes out a session file to disk containing text input, output and traces, in the current project folder. See notranscript

transcript

unbury

environment

Entrée: name or list
Sortie: none

Unburies the named procedures. See bury.

unbury "myproc

unburyall

environment

Entrée: none
Sortie: none

Unburies all procedures and containers currently buried in the workspace. See bury

unburyall

unstep

environment

Entrée: word or list
Sortie: none

Unmarks the named procedure or procedures from stepping. See step

unstep "procedure

untrace

environment

Entrée: list
Sortie: none

Stops tracing the specified procedures.

untrace [myproc]

user

environment

Entrée: none
Sortie: word

Returns the name of the current user.

print user

users

environment

Entrée: none
Sortie: list

Returns a list of the defined users.

print users

view

environment

Entrée: word or list
Sortie: none

Opens the editor with the output provided to view.

view table "table
view workers

viewhelp

environment

Entrée: none
Sortie: 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

Entrée: none
Sortie: 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

Entrée: none
Sortie: list

Returns a list indicating the calling turtle's currently inhabited sector, based on the selected zone. See selectzone, putsector

show whichsector

whichzones

environment

Entrée: none
Sortie: list

Returns a list of the zones the turtle is currently inside of. See zones, newzone

show whichzones

windowpos

environment

Entrée: none
Sortie: list

Returns the absolute screen position of the top-left corner of the turtleSpaces window. See windowsize, displaysize

show windowpos

windowsize

environment

Entrée: none
Sortie: list

Returns the size of the turtleSpaces window in pixels. See windowpos, displaysize


xray

environment

Entrée: none
Sortie: none

Causes the fill opacity to be forced to 50 in all shapes in the calling turtle's track, excluding the turtle model. See noxray, which turns it off.

xray

year

environment

Entrée: none
Sortie: number

Returns the current year.

print year
2020

zones

environment

Entrée: none
Sortie: list

Returns a list of all zones defined in the current space.

show zones

newslider

environment

Entrée: "name [min max] | [parameter] [min max]
Sortie: none

Creates an on-screen range slider. Given a quoted name, the slider binds to a global container of that name; given a list such as [heading] (or [heading turtlename] to target another turtle), it binds live to that turtle parameter (heading, pitch, roll, pensize, pencolor, fillcolor, penshade, fillshade, penopacity, fillopacity, pendepth, mass, friction or elasticity) so dragging drives the turtle in real time. The second list holds min and max, optionally followed by a default value and a label: [min max default label]. The default may also be a list [default step]; a whole-number step makes an integer slider. Any words after the numbers become the label, so multi-word labels need no nesting. Re-declaring a slider keeps its current value if it still fits the new range. Sliders are session-global overlays: they survive clearscreen and are cleared only by deletesliders, resetall or loading a workspace.

newslider "speed [0 100 25]
newslider "arms [3 12 [6 1] Arms]
newslider [heading] [0 360 90 Facing]

deleteslider

environment

Entrée: "name
Sortie: none

Removes the named slider from the screen. Does nothing if no slider with that name exists.

deleteslider "speed

deletesliders

environment

Entrée: none
Sortie: none

Removes all sliders from the screen.

deletesliders

sliderp

environment

Entrée: "name
Sortie: boolean

Returns true if a slider with the given name exists, otherwise false.

show sliderp "speed
true

slider

environment

Entrée: "name
Sortie: number

Returns the current value of the named slider. Reports an error if no such slider exists.

newslider "speed [0 100 40]
show slider "speed
40

setslider

environment

Entrée: "name value
Sortie: none

Sets the named slider to the given value, clamped to its range, and applies the change to its binding. Reports an error if no such slider exists.

newslider "speed [0 100]
setslider "speed 75

setshadertype

environment

Entrée: "type | [type type …]
Sortie: none

Selects the post-processing shader effect applied when the shader is enabled. Available types include ao (ambient-occlusion contact shading: creases and the ring where objects meet the floor darken, grounding the scene), background (shows pictures through your drawing: each [imagename colorindex] pair scales the named loaded image to fill the canvas - aspect preserved, centered, overflow cropped - and everything drawn in that palette colour becomes a window onto the image, while transparent parts of the image keep the drawn colour; set the pairs with setshadersettings, and re-issuing shader refreshes the image contents from the workspace), blur, bokeh (depth of field: whatever the camera looks at stays sharp and the rest defocuses, with highlights blooming into discs; focus/range as percent of the camera-to-subject distance, strength sets the blur size), charcoal, chromatic, crayon, crosshatch, daub (discrete brush dabs over a toned ground; coverage sets how fully they blanket it, variety drifts each dab's colour and elongation stretches the dabs into ovals - 100 is round, higher makes thinner streaks), distortion, dither (quantizes to a palette with ordered dithering at a virtual width x height resolution, like pixel's), dream, edge, emboss (a gray relief: the scene renders as if pressed into metal and lit from one side; depth sets the relief contrast and angle the light direction in degrees), fisheye, focus (smudge-blurs the joins between patches of colour into smooth gradients; degree sets the smudge strength and distance the gradient width in pixels — flat areas stay unchanged, and with setshaderbackground false the background neither smears into shapes nor picks up their colour), fog (distance haze fading to the background color; start/end as percent of the camera-to-subject distance), glitch (VHS-style picture corruption: horizontal bands of the picture briefly shear sideways; width sets the maximum band height in pixels, distance the maximum sideways shear in pixels, and frequency how often glitch events fire — 100 is the baseline cadence, 0 never fires), gloss (shiny wet-plastic relighting: a key light adds highlights to every surface, wetness darkens the base with a sky-tinted sheen at grazing angles, and smooth above 0 rounds highlights across low-poly facets), glow, goo, grayscale, grid, halftone (CMYK print screening: the colour separates into cyan/magenta/yellow/black ink dots at their traditional screen angles, with grainy paper), invert, led (a luminance dot matrix, like an LED video wall), merge (overlapping filled 2D shapes on the same plane - fills, spots, ellipses and polyspots alike - fuse into one form, the sharp crossings where their outlines meet rounded into smooth fillets; smoothing sets the fillet size, and colorblend above 0 also blends the partners’ colours across the seam - erasing a shape or switching types restores the originals untouched), mirror (flips the scene horizontally, vertically or both; lowering the shader amount cross-fades the flipped scene over the original for a double exposure), kaleidoscope (folds the scene into segments mirrored radial wedges around a configurable centre at centerx/centery, rotated by angle degrees; lowering the shader amount cross-fades the folded scene over the original), mochi (turtlemochi's complement: the scene's drawn geometry bonds with itself - pen strokes, stamps, fills and typeset text pull toward each other where they lie close, true vertex-to-vertex, so drawn material clumps and kisses like dough as you draw, and erasing a piece lets its partners spring back; the same range and cling settings apply as turtlemochi (though mochi's range reaches to 500 rather than 300), but mochi is much heavier - meant for renderloop animations rather than interactive scenes), motionblur (moving shapes smear across their recent positions like a long-exposure photograph, sharpening again when they stop; the object's current position always renders fully defined over the trail, persist sets how far back the blur reaches and intensity how boldly the smear shows), neon, noise (film grain that stays frozen once drawn; call setshadertype again to deal a fresh grain — each instance in a chain deals its own, so chained noise shaders layer different grains), frost (frosted glass: the scene refracts through a bumpy relief and scatters softly; amount is the refraction distance and grain the relief cell size, both in pixels — like noise, the relief stays frozen until setshadertype is re-issued), oil, outline (ink lines where scene depth changes), pencil, phosphor (CRT phosphor persistence: the scene stays crisp while a decaying ghost lingers where things were; persist sets how long the ghost lingers and intensity how boldly it shows), photo (grades the scene's brightness, contrast, saturation and hue), pixel (pixelation: the scene shows as a grid of width x height cells), hexpixel (pixelation with hexagonal cells: the scene shows as a honeycomb of width columns x height rows of hexes), posterize, reflection (wet-floor screen-space reflections; floor=1 limits them to up-facing surfaces, and only what's on screen can appear in a reflection), ripple (concentric rings spread from the screen centre like a pond drop, distinct from water's directional flow; frequency sets the ring count, amplitude their strength, and speed animates them outward — 0 freezes the rings), rolling, scanlines (a tracking setting above 0 adds a bright refresh band sweeping the screen at that speed), sepia, shadow (cast shadows from the same key light as gloss; only what is on screen can cast, and softness fades shadows from more distant occluders), shadowmask (a CRT RGB-triad aperture grille over the picture: scale sets the triad cell size in pixels and intensity how strongly the mask shows), sharpen (unsharp-mask sharpening: fine detail and edges pop; amount sets the strength and radius the detail size in pixels), sketch (hatch strokes that texture shapes directly, following each shape's form - wrapping around curved surfaces and circling inside a flat spot - while the scene keeps its colour; desaturate pulls it toward grey, hardness sets stroke opacity and widthvar varies stroke width), static, swirl (twirls the image around the screen centre - strongest twist in the middle, fading to nothing at radius percent of the half-screen; angle sets the twist in degrees, negative for the other direction), tint (grades scene brightness through a palette ramp), toon, turtlemochi (nearby turtles attract like stretchy dough: near edges squash toward each other, cling and stretch as they separate, then snap free with a jiggle; a light approximation suited to interactive scenes; range sets the attraction reach as percent of the pair's combined sizes, cling how long a bond stretches before letting go; combine with mochi, e.g. setshadertype [turtlemochi mochi], for turtles and scenery both), vignette, water (the scene seen through moving water: distortion pushed harder on both axes, with a diffusion shimmer and a soft water blur; ripple sets the ripple size, diffusion the shimmer and blur the softness), watercolor (transparent washes on paper: pigment pools along edges, granulates on the paper tooth and blooms where wet). turtlemochi, mochi and merge are surface effects: they deform the scene's models themselves rather than filtering the image, and can accompany any other types in a list, e.g. setshadertype [turtlemochi glow]. Use shadertypes to list them. A list activates a chain of up to 16 shaders applied in order, e.g. setshadertype [pixel glow]; a chain fits at most one of dream, motionblur or phosphor. Use setshaderamount, setshaderbackground and setshadersettings with lists to control each chained shader separately — every instance keeps its own settings, even when the same type appears more than once, and keeps them while the type at its chain position is unchanged. See shader, shadertype, setshaderamount, setshaderbackground, setshadersettings

shader
setshadertype "glow

shadertype

environment

Entrée: none
Sortie: word or list

Returns the currently selected post-processing shader type, or the list of types when a shader chain is active. See setshadertype, shadertypes

show shadertype
pixel

shadertypes

environment

Entrée: none
Sortie: list

Returns the list of available post-processing shader types. See setshadertype, shader

show shadertypes
[ao blur bokeh charcoal chromatic crayon crosshatch daub distortion dither dream edge emboss fisheye focus fog frost glitch gloss glow goo grayscale grid halftone hexpixel invert kaleidoscope led merge mirror mochi motionblur neon noise oil outline pencil phosphor photo pixel posterize reflection ripple rolling scanlines sepia shadow shadowmask sharpen sketch static swirl tint toon turtlemochi vignette water watercolor]

setshaderamount

environment

Entrée: amount | [amount amount …]
Sortie: none

Sets how much of the image each shader replaces, as a percentage from 0 to 100. The shader always runs at full strength (tune its character with setshadersettings); the amount mixes its output with the untouched source, so 100 (the default) shows only the effect and lower values let the original picture show through. A single value applies to every shader in the chain (replacing any per-shader list); a list sets each chained shader's amount in setshadertype order, and a shorter list leaves later shaders on the single amount. See setshadertype, setshaderbackground, setshadersettings, shaderamount

setshadertype "blur
setshaderamount 80

shaderamount

environment

Entrée: none
Sortie: number or list

Returns the strength of the current post-processing shader effect as a percentage, or the list of per-shader amounts when one was set for a chain. See setshaderamount

show shaderamount
100

shaderparameters

environment

Entrée: "type
Sortie: list

Returns the parameters of the given post-processing shader type as three positionally-aligned sublists — names, default values, and [min max] ranges — so item i of each sublist describes the same parameter. The names are in the order shadersettings reports and setshadersettings expects their values. Non-numeric leading settings (tint and dither's palette, background and texture's [imagename colorindex] pairs) appear in the names sublist with an empty list holding their place in the defaults and ranges sublists. Shader types without parameters return [[] [] []]. See shadersettings, setshadersettings, shadertypes

show shaderparameters "photo
[[brightness contrast saturation hue] [100 100 100 0] [[0 300] [0 300] [0 300] [-180 180]]]

shadersettings

environment

Entrée: none
Sortie: list

Returns the current parameter values of every shader in the active chain, one entry per shader instance in setshadertype order. Each entry's values are in shaderparameters order for that shader's type: shaders with a single parameter appear as a bare number, shaders without parameters as an empty list and others as a value list (tint appears as its palette and dither as [palette width height]). The result can be passed back to setshadersettings unchanged. See shaderparameters, setshadersettings, setshadertype

setshadertype [toon posterize]
show shadersettings
[[3 80] 3]

setshadersettings

environment

Entrée: [settings settings …]
Sortie: none

Sets the parameters of the shaders in the active chain, one settings entry per shader instance in setshadertype order, so each instance keeps its own settings even when the same type appears more than once in the chain. A shorter list covers the leading shaders only, and an empty [] entry leaves that shader unchanged. Within an entry, values are positional in the order given by shaderparameters for that shader's type; a bare value or a shorter list sets the leading parameters and leaves the rest unchanged, and values outside a parameter's range are clamped. Accepts whatever shadersettings returns, so settings round-trip. A pixel entry takes [width height], the virtual screen resolution in cells (setshadersettings [[120 90]] gives chunky pixels; palette, dither and scanline treatments are their own chain types). A tint entry takes a palette directly (setshadersettings [[[0 0 30] [100 60 0]]] grades dark to light through those colours); a dither entry takes [palette <width> <height>], the palette plus its virtual dither resolution. A background or texture entry takes a list of up to four [imagename colorindex] pairs naming loaded images (setshadersettings [[[pic 1]]] shows image pic through everything drawn in colour 1; a texture entry instead overlays the image's desaturated detail on everything drawn in that colour). Settings follow their chain position: setshadertype keeps a shader's settings while the type at that position is unchanged, and resetall restores all shader parameters to their defaults. See shaderparameters, shadersettings, setshadertype, setshaderamount, setshaderbackground

setshadertype [charcoal charcoal toon]
setshadersettings [[150 100] [40 200] [5 100]]

setshaderbackground

environment

Entrée: boolean | [boolean boolean …]
Sortie: none

Controls whether a shader's effect covers the screen background: the paper behind the drawing-media shaders (pencil, sketch, crosshatch, charcoal, crayon, oil, daub, watercolor) and halftone's print, the black ink field behind led's dots, the darkened scene behind neon's tubes, and the photo shader's colour grade. With false, the effect applies only to what is drawn on the screen — the paper shaders render their marks exactly as they would on paper while the background shows through untouched, and photo grades the drawing but not the background. Defaults to true. A single true or false applies to every shader in the chain (replacing any per-shader list); a list sets each chained shader in setshadertype order, and a shorter list leaves later shaders on the single setting. Shaders without a background of their own ignore it. See setshadertype, setshaderamount, shaderbackground

setshadertype "pencil
setshaderbackground false

shaderbackground

environment

Entrée: none
Sortie: boolean or list

Returns whether shaders apply their own background, or the list of per-shader settings when one was set for a chain. See setshaderbackground

show shaderbackground
TRUE