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.
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:
to product :a :b
make "result 0
repeat :a [make "result sum :result :b]
output :result
end
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.
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:
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.
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:
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.
Draw a few straight lines with the pen down, then spline turns the last points into a smooth curve:
repeat 6 [forward 40 right 60]
spline 5 6
pinspline does the same for points you have marked with pin, and the result can be filled with pinfill.
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:
shader
setshadertype "pencil
setshadersettings [[100 100 150 45]]
show shadertypes lists every effect, and show shaderparameters "pencil lists the settings an effect takes, in order.
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:
newturtle "ball
ask "ball [setphysicsmode "3d penup setmodel [icosphere 5] showturtle]
ask "ball [elastic setmyforces [[180 50]]]
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.
Record what is on screen and download it as a video file:
savewebm 10
savemp4 [10 2]
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.
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:
newbutton "go [40 80 60 90 Launch rocket]
newslider [heading] [0 360 0 Heading]
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:
loadimage "marquee "marquee.png
newsticker "marqueesticker "marquee
placesticker "marqueesticker [25 25 75 75]
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.
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.
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 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.
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:
forwrd 50
Shelly’s error help appears when you are signed in.
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:
AI answers can be wrong, so check them. See AI features in the Privacy Policy for what is sent.
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.
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.
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 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 has a history that can be programmatically read (historycount historyitem historylist).
Not sure where to start? See who turtleSpaces is for.