Draw with a language made for lines, color, and rhythm.

Write commands line by line. The turtle moves, turns, and paints. Variables, loops, conditions, and functions are all supported.

Basic syntax

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

Movement

CommandWhat it does
forward n / fdMove forward. Draws if the pen is down.
backward n / bkMove backward.
left n / ltTurn left in degrees.
right n / rtTurn right in degrees.
penup / pendownLift or lower the pen.
homeReturn to center, heading right (0°).
setxy x yTeleport. Aliases: goto, teleport, setpos.
setheading nFace an absolute angle. 0 is right, -90 is up.
pos / headingPrint the current position or angle in the console.

Style

CommandWhat it does
color redStroke color. Named CSS colors, hex, or hsl(_ * 10, 50, 60).
width 2.5Stroke thickness.
background #08090dFill the canvas.
beginfill goldendfillFill the enclosed path.
circle r / dot rCircle at the turtle, or a filled dot.
curve 180Arc approximation. Default 180 steps.
label "Hello" size=20 color=goldDraw text. Optional: font, x, y.
hideturtle / showturtleHide or show the turtle marker.

Control flow

repeat 6
  forward 80
  right 60
endrepeat

if _ mod 2 = 0 then color gold
if size > 20
  forward size
else
  dot 4
endif

Functions

function hex size
  repeat 6
    forward size
    right 60
  endrepeat
endfunction

hex 90

Expressions

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.

Studio shortcuts

Ctrl+Enter run · Esc stop · drag the canvas to pan · scroll to zoom · Export PNG saves the drawing.