Features

This is a tour of what turtleSpaces can do, with a short example for each feature. You can paste any example into the IDE and run it. To see every command, browse the reference.

A full Logo language

turtleSpaces is based around a full implementation of the Apple (LCSI) Logo environment. Logo has been called “the most powerful and user-friendly computer language ever implemented on a personal computer.” (David Thornburg)

Logo is a ‘functional’ language which is based on ‘primitives’ (commands) that return output to each other – they can be chained to retrieve, calculate and transform data in various ways before storing or actioning based on them.

Users can create ‘procedures’ which behave just like (and can replace) primitives. A procedure can take parameters and return output, just like a primitive. Take the primitive product, which multiplies two numbers:

We’ve effectively replaced product with our own procedure.

Logo was originally intended to be a language playground for children. As a result, it has very powerful string and ‘list’ handling (an array of ‘items’), such as [pig duck cow] or [[Bob 53][Frank 22][Sue 34]]. There are various primitives to build, order and re-order lists and strings, called ‘words’ in Logo.

  • We have added ‘soft’ lists, which are ‘resolved’ (or evaluated) at runtime. These lists are surrounded by curly braces instead of square brackets: {xpos ypos zpos} {hours minutes seconds}
  • We have added more traditional arrays in the form of tables. Tables are predefined arrays of x y (z). The contents are read and set using cell and putcell.
  • There is also positional data storage available in the form of zones.
  • You can display text in different fonts, sizes and colors.

Turtles in three dimensions

The turtle was added to Logo later, but became its most recognisable feature. The turtle is a graphical ‘cursor’ which moves relative to itself, unlike other ‘absolute’ graphical systems (although you can operate absolutely in Logo as well). You tell the turtle to move and turn and it does so relative to its position and orientation.

In turtleSpaces we have added significant additional functionality to turtles:

  • The turtle can move in three dimensions. This means that in addition to forward, back, left and right, there is up, down, rollleft, rollright. For expediency we’ve also added raise, lower, slideleft and slideright.
  • position returns the turtle’s location using three co-ordinates, the traditional pos returning 2 (x, y)
  • Along with heading, setheading we’ve added pitch, setpitch and roll, setroll
  • orientation, setorientation sets all three, based on setorientationorder, which specifies the order in which the three orientation parameters (heading, pitch and roll) are applied (curse you, Euler!)
  • For more reliable orientation, one can use vectors, setvectors – we also have a variety of vector-related primitives.
  • You can set an orbit anchor with setanchor and then orbit around it in degrees (orbitleft, orbitright, orbitup, orbitdown). This is super-useful for cameras and for drawing interesting patterns.
  • You can create new turtles, either ‘persistent’ turtles using the newturtle primitive, or ephemeral turtles using hatch, whose output can be merged with its parent. You can determine where turtles are relative to each other using near, inside, facingp, location and others.
  • You can set a turtle’s ‘model’ to any Logo drawing code using tags, which allow you to ‘bracket’ sections of a turtle’s ‘track’ (its graphical output), using it for models or turning it on or off. Tracks can also be copied, loaded and saved. Models can have arbitrary commands inserted before them using setpremodel, allowing for the orientation of the model to be changed as needed.
  • You can undo the last thing a turtle did using backtrack, you can make a procedure out of a turtle’s track using assemble, allowing for model creation ‘on the fly’.

There are multiple spaces the turtle(s) can occupy, and turtles can be spread across spaces (newspace selectspace). Each space is an infinite three-dimensional canvas.

Any turtle can be a camera, selected using setview. You can change the camera’s position relative to its turtle using setviewpoint. Turtles also act as lights – they can be a spot light, a point light or no light at all.

Procedures and variables (containers) along with a number of settings are turtle-specific. You can share containers between turtles, and you can share procedures using the special libby (library) turtle.

Turtles are ‘driven’ by workers, which are process threads. One worker can drive multiple turtles (consecutively), or multiple workers can drive multiple turtles. Multiple workers can (attempt to) drive the same turtle! Workers and turtles are not the same. Think of turtles as cars, and workers as drivers.

Shapes

Where traditional Logo turtles can only create lines or fill spaces, because turtleSpaces is a 3D environment we have a number of other shapes that can be created, including:

  • voxel
  • voxeloid
  • ramp
  • tent
  • sphere
  • sphereslice
  • cutsphere
  • cutsphereslice
  • spheroid
  • spheroidslice
  • cutspheroid
  • cutspheroidslice
  • icosphere
  • icospheroid
  • amigaball
  • amigaballoid
  • cylinder
  • cylinderslice
  • cylinderarc
  • cylinderarcslice
  • cylindroid
  • cylindroidslice
  • cylindroidarc
  • cylindroidarcslice
  • duocylindroid
  • tube
  • tubearc
  • tubeslice
  • tubearcslice
  • tuboid
  • tuboidarc
  • tuboidslice
  • tuboidarcslice
  • duotuboid
  • cone
  • coneslice
  • cutcone
  • cutconeslice
  • conoid
  • conoidslice
  • cutconoid
  • cutconoidslice
  • duocutconoid
  • funnel
  • funnelslice
  • cutfunnel
  • cutfunnelslice
  • cutfunneloidslice
  • funneloid
  • funneloidslice
  • cutfunneloid
  • duocutfunneloid
  • pyramid
  • pyramoid
  • dome
  • domoid
  • torus
  • torusslice
  • toroid
  • toroidslice
  • tetrahedron
  • tetrahedroid
  • octahedron
  • octahedroid
  • dodecahedron
  • dodecahedroid
  • inscribe
  • typeset

You can speckle (or pixelate a la Minecraft) voxels and quads. You can also create pixel-based plots, in both two and three dimensions, using plot.

See the shapes and graphics reference for every shape’s inputs.

Splines

Draw a few straight lines with the pen down, then spline turns the last points into a smooth curve:

pinspline does the same for points you have marked with pin, and the result can be filled with pinfill.

Shaders and effects

Post-processing shaders restyle the whole scene: pencil, oil, crayon, watercolor, toon, glow, bokeh, motion blur and more. setshadertype takes one effect or a list of effects to chain, and setshadersettings takes one list of settings for each effect, in the same order:

show shadertypes lists every effect, and show shaderparameters "pencil lists the settings an effect takes, in order.

2D and 3D physics

Turtles can become physical bodies that fall, bounce and collide. Physics mode is set per turtle, so set it inside the turtle’s own ask block:

setmyforces takes a list of forces, each a heading and a speed, so this one pulls the ball toward heading 180 like gravity in a platform game. “2d uses a 2D engine and “3d a full 3D one. See the physics reference for forces, elasticity, friction and mass.

Video recording

Record what is on screen and download it as a video file:

The first records ten seconds as WebM. The second records ten seconds as MP4, keeping every second frame. For a still image, savepng renders the scene at any size you give it, for example savepng [1920 1080] "mypicture.png.

Stickers, buttons and sliders

Build a game or a toy with on-screen controls. Stickers are images fixed to the screen, above the 3D view. Buttons can be tapped on phones and tablets. Sliders change a value while the program runs:

The button’s rectangle and the sticker’s area are given in percent of the screen. A slider can be bound to a container by name, or to a turtle setting such as heading, pen size or fill color. To make a sticker, load an image you have added to your project, then place it:

The Blocks editor

Every program can also be edited as blocks. The Blocks editor shows the same procedures as the text editor, so changes in one appear in the other. Learners can start with blocks and move to typing the language when they are ready.

Publishing and Remix

Publish a project and it appears in the gallery, where anyone can play it in the full-screen player or share an embeddable player. Anyone can Remix a published project: they get their own copy to change and publish again.

Classrooms and groups

Teachers can make a class group and share one join link with their students, who sign in or register through it to join the class. Anyone can use the IDE without an account. You need to sign in to save to your account, publish, or use Shelly. See turtleSpaces for teachers.

The welcome tour

The first time you open the IDE, Shelly the turtle shows you around: the menu bar, the workspace, the run controls, the console, the 3D view and the Examples. It takes about a minute, and Shelly can read it aloud. To see it again, choose Help → Welcome. You can also read the same tour here on the website.

Shelly, the error assistant

When a program stops with an error, Shelly pops up and offers to have Claude explain it. What does this mean? explains the error in general. Explain it in my code explains what went wrong in your own program. Try a typo:

Shelly’s error help appears when you are signed in.

Ask Claude

When you are signed in, the editor has a Claude tab, the AI code assistant, where you can ask questions about Logo and about your program. The round Claude button at the top right of the text editor and the Blocks workspace offers three choices:

  • Comment procedure adds comments to the procedure you are editing.
  • Explain with Claude explains the current procedure, or the whole program, in plain language.
  • Teach Me How turns it into a Turtorial (see below).

AI answers can be wrong, so check them. See AI features in the Privacy Policy for what is sent.

The Turtorial

A Turtorial is a lesson Shelly makes from a program. Instead of handing you the answer, it walks you through building the program yourself, step by step, with hints, quick quiz questions and a Check my work button. It is pitched at the learner’s level, using the badges they have earned. With nothing to go on, it assumes a beginner.

The Turtorial starts in an empty workspace, so if you have unsaved work you are asked to save it first. If you stop part-way, choose Help → Resume (it names the lesson and the step you reached) to carry on where you left off in the same browser. The Turtorial needs you to be signed in.

Daily prompt

Need an idea? Every day there is a new creative word, shown when the IDE starts: “Need an idea? Today’s prompt is: …”. The word changes at midnight UTC. Make something about it and tag it with Today’s Prompt when you publish, then browse the gallery under the same prompt to see what everyone else made today.

Five languages

The IDE and this website are available in English, Español, Français, 日本語 and Polski. Choose a language under Settings → Language. Logo commands stay in English in every language, so code examples work everywhere.

Sound and music

Sound primitives include the traditional toot primitive, noise (which generates white noise), playnotes, and playmusic. You can also use speech synthesis with say, where your browser or system supports it.

The interactive prompt

The interactive prompt has a history that can be programmatically read (historycount historyitem historylist).

Not sure where to start? See who turtleSpaces is for.