FORWARD n / FD n | Move forward n steps |
BACK n / BK n | Move backward n steps |
LEFT n / LT n | Turn left n degrees |
RIGHT n / RT n | Turn right n degrees |
HOME | Return to center, facing up |
SETPOS [x y] | Move to position [x, y] |
SETX n | Set X coordinate |
SETY n | Set Y coordinate |
SETHEADING n / SETH n | Set heading (0=up, 90=right) |
XCOR | Returns current X coordinate |
YCOR | Returns current Y coordinate |
HEADING | Returns current heading |
POS | Returns current position [x y] |
TOWARDS [x y] | Returns angle from turtle to point |
DISTANCE [x y] | Returns distance from turtle to point |
PENUP / PU | Lift pen (stop drawing) |
PENDOWN / PD | Lower pen (start drawing) |
SETPENCOLOR color / SETPC color | Set pen color (name or [r g b]) |
SETPENSIZE n | Set pen width |
PENERASE / PE | Pen erases instead of draws |
PENPAINT / PPT | Pen draws normally |
SETBACKGROUND color / SETBG color | Set background color |
PENCOLOR / PC | Returns current pen color |
PENSIZE | Returns current pen size |
Use color names: red, blue, green, yellow, orange, purple, black, white, cyan, magenta, pink, brown, gray
Or RGB values: [255 0 0] for red
CIRCLE radius | Draw a circle at turtle's position |
ARC angle radius | Draw an arc and move turtle along it |
FILLED [...] | Fill the shape drawn inside brackets |
REPEAT n [...] | Repeat commands n times |
IF cond [...] | Execute if condition is true |
IFELSE cond [...] [...] | If-else statement |
FOR [var start end] [...] | For loop (step=1) |
FOR [var start end step] [...] | For loop with step |
WHILE [cond] [...] | While loop |
STOP | Exit current procedure |
WAIT n | Pause for n milliseconds |
CLEARSCREEN / CS | Clear screen and reset turtle |
CLEAN | Clear screen, keep turtle position |
HIDETURTLE / HT | Hide the turtle |
SHOWTURTLE / ST | Show the turtle |
WRAP | Turtle wraps around edges |
WINDOW | Turtle can go beyond edges |
FENCE | Turtle stops at edges |
TO SQUARE :size REPEAT 4 [FD :size RT 90] END SQUARE 100
MAKE "name value | Create/set variable |
:name | Get variable value |
LOCAL "name | Create local variable |
THING "name | Get variable value (alternative) |
TO DOUBLE :n OUTPUT :n * 2 END PRINT DOUBLE 5 ; prints 10
TELL n | Select turtle n (creates if needed) |
ASK n [...] | Run commands with turtle n |
WHO | Returns current turtle number |
TURTLES | Returns list of all turtle numbers |
+ - * / | Basic operations |
REMAINDER a b | Modulo (a % b) |
POWER a b | Exponentiation (a^b) |
SQRT n | Square root |
ABS n | Absolute value |
INT n | Integer part |
ROUND n | Round to nearest integer |
RANDOM n | Random integer 0 to n-1 |
MIN a b | Smaller of two numbers |
MAX a b | Larger of two numbers |
SIGN n | Returns -1, 0, or 1 |
EXP n | e raised to power n |
LOG n / LN n | Natural logarithm |
LOG10 n | Base-10 logarithm |
SIN n | Sine (degrees) |
COS n | Cosine (degrees) |
TAN n | Tangent (degrees) |
ARCTAN n | Arc tangent (returns degrees) |
= < > <= >= <> | Comparison operators |
AND a b | Logical AND |
OR a b | Logical OR |
NOT a | Logical NOT |
PRINT value | Print to output |
SHOW value | Print with brackets for lists |
TYPE value | Print without newline |
WORD a b | Combine two words into one |
CHAR n | Character for ASCII code n |
ASCII word | ASCII code for first character |
UPPERCASE word | Convert to uppercase |
LOWERCASE word | Convert to lowercase |
READWORD | Prompt user for a word |
READLIST | Prompt user for a list |
[a b c] | List literal |
LIST a b | Create list from items |
SENTENCE a b / SE a b | Combine into flat list |
FPUT item list | Add item to front |
LPUT item list | Add item to back |
FIRST list | First item |
LAST list | Last item |
BUTFIRST list / BF list | All but first |
BUTLAST list / BL list | All but last |
ITEM n list | Get nth item (1-indexed) |
COUNT list | Number of items |
REVERSE list | Reverse list or word |
EMPTY? list | True if list is empty |
LIST? value | True if value is a list |
NUMBER? value | True if value is a number |
WORD? value | True if value is a word |
MEMBER? item list | True if item is in list |
The Library stores reusable procedures you can add to your code. Save time by reusing common shapes and patterns!
Click the 📦 Library button in the toolbar, or press Ctrl+L
; After clicking "Insert" on SQUARE, your editor has: TO SQUARE :size REPEAT 4 [FD :size RT 90] END ; Now add this line below to actually DRAW: SQUARE 100
Key point: Inserting adds the definition. You must call the procedure by name to draw!
; Draw multiple squares in a row SQUARE 30 RT 90 FD 50 SQUARE 50 RT 90 FD 70 SQUARE 70 ; Make a pattern with SQUARE REPEAT 4 [SQUARE 60 RT 90] ; Use POLYGON (needs 2 inputs: sides and size) POLYGON 5 80 ; draws a pentagon POLYGON 6 60 ; draws a hexagon ; Colorful flowers using FLOWER SETPC "red FLOWER 6 40 PU RT 90 FD 100 PD SETPC "blue FLOWER 8 30
TO ... END| All | Shows all available procedures |
| Shapes | SQUARE, TRIANGLE, POLYGON, STAR, HEXAGON |
| Patterns | SPIRAL, SQUIRAL, FLOWER, TREE |
| Colors | RANDOMCOLOR, RAINBOW |
| My Procedures | Procedures you have saved |
Draw a simple triangle
Draw a simple square
Draw a house with a roof
Draw a 5-pointed star
Draw a smiley using CIRCLE and ARC
Draw a flower pattern
Draw a colorful rainbow
Define and use a polygon procedure
Draw a recursive spiral
Draw a fractal tree
Draw a fractal triangle
Uses TOWARDS and DISTANCE to chase a target
Uses READWORD for user input
Uses RANDOM and list operations
Uses REVERSE to mirror words
Share this link with others:
Anyone with this link can view and edit your code.
LogoLab is committed to ensuring digital accessibility for all users, including those with disabilities. We strive to comply with WCAG 2.1 Level AA guidelines and the European Accessibility Act (EAA).
If you encounter accessibility barriers or have suggestions for improvement, please open an issue on GitHub.
Last updated: January 2026