Write commands line by line. The turtle moves, turns, and paints. Variables, loops, conditions, and functions are all supported.
One command per line. Comments start with // or #. The loop index is _ and starts at 1.
let size = 100 speed 0 home forward size right 90
| Command | What it does |
|---|---|
forward n / fd | Move forward. Draws if the pen is down. |
backward n / bk | Move backward. |
left n / lt | Turn left in degrees. |
right n / rt | Turn right in degrees. |
penup / pendown | Lift or lower the pen. |
home | Return to center, heading right (0°). |
setxy x y | Teleport. Aliases: goto, teleport, setpos. |
setheading n | Face an absolute angle. 0 is right, -90 is up. |
pos / heading | Print the current position or angle in the console. |
| Command | What it does |
|---|---|
color red | Stroke color. Named CSS colors, hex, or hsl(_ * 10, 50, 60). |
width 2.5 | Stroke thickness. |
background #08090d | Fill the canvas. |
beginfill gold … endfill | Fill the enclosed path. |
circle r / dot r | Circle at the turtle, or a filled dot. |
curve 180 | Arc approximation. Default 180 steps. |
label "Hello" size=20 color=gold | Draw text. Optional: font, x, y. |
hideturtle / showturtle | Hide or show the turtle marker. |
repeat 6 forward 80 right 60 endrepeat if _ mod 2 = 0 then color gold if size > 20 forward size else dot 4 endif
function hex size
repeat 6
forward size
right 60
endrepeat
endfunction
hex 90
Available math: sin cos tan sqrt abs floor ceil round min max pow random hsl rgb pi e. Canvas size is canvasw and canvash. Use mod for remainder. Hex colors like #e8b86d are supported; a # comment must sit on its own line.
Ctrl+Enter run · Esc stop · drag the canvas to pan · scroll to zoom · Export PNG saves the drawing.