🐢 Turtle Draw: Code a Drawing

Tap blocks or type commands to steer the turtle · 12 drawing challenges and free draw · Save your picture · Grades 2–8

Done 0 / 12

Challenge 1

Blocks (tap to add a line)

Change the numbers by typing. Press Ctrl+Enter (or Command+Enter) to draw from the keyboard.

Command cheat sheet
  • forward 50 (or fd 50): move and draw
  • back 50 (or bk 50): move backward
  • right 90 / left 90 (rt, lt): turn on the spot, in degrees
  • repeat 4 [ ... ]: do the commands in the brackets 4 times
  • repcount: 1, 2, 3... counts the times round a repeat
  • pen up / pen down: stop or start drawing
  • pen color blue: black, red, orange, yellow, green, blue, purple, pink, brown, gray, teal, white
  • pen size 6: line thickness from 1 to 30
  • home: go back to the start

How Turtle Draw Works

The turtle holds a pen. When it moves forward, it draws a line behind it. Your program tells it how far to go and how far to turn. Turns are in degrees: right 90 is a square corner, and four of those make a full turn of 360 degrees.

Tap a block to add that command as a new line, then change the number by typing. You can also type everything yourself. Put one command on each line, or several on one line with spaces between them. Capital letters do not matter.

Making shapes with repeat

Many shapes are one small pattern done again and again. A square is “forward 100, right 90” four times, so repeat 4 [ forward 100 right 90 ] draws it in one line. For any shape with equal sides, the turns add up to 360 degrees. That is why a triangle turns 120 (360 ÷ 3) and a hexagon turns 60 (360 ÷ 6). The star turns 144 five times, which adds up to 720: two full turns, which is why its lines cross.

Growing lines with repcount

Inside a repeat, the word repcount means “which time round is this?” It is 1 the first time, 2 the second time, and so on. forward repcount * 8 draws a line of 8, then 16, then 24, which is how the spiral challenge grows. You can use + − * / and brackets with numbers.

When something goes wrong

If the turtle does not understand a line, it tells you the line number and what it expected, and highlights that line. It also suggests a fix for small spelling slips, such as “forwrd”. In a challenge, the page checks your lines against the blue outline. If a line is too long or turns the wrong way, it tells you whether part of the outline is missing or a line goes outside it.

For Parents and Teachers

Turtle graphics give instant visual feedback for every number a student changes, so they are a good bridge from block coding to typed code. The challenges move from single commands to loops, pen up and pen down, nested shapes and a counter variable.

Completion code

Finishing a challenge shows a completion code with the number of challenges finished on that device out of 12 (activity ID CTD). Check codes on the Score Checker. Progress is stored only in the browser on that device. Nothing is sent anywhere, and the downloaded picture is made in the browser.

Standards

Turtle Draw supports these CSTA K–12 Computer Science Standards (2017):

Sources

FAQ

Which commands does the turtle know?

forward, back, right, left, repeat with square brackets, pen up, pen down, pen color with a color name, pen size and home. Short forms fd, bk, rt, lt, pu and pd work too. Inside a repeat, repcount counts 1, 2, 3 as the loop goes round.

Why does my challenge say lines go outside the outline?

The checker compares your lines with the blue outline, allowing a few steps of wobble. A line that is too long, a turn the wrong way or a turn that is too big puts lines outside it. Draw at Slow speed and watch where the turtle first leaves the outline.

Can I save my drawing?

Yes. Press Download PNG to save the picture to your device. The blue outline and the turtle are not included, just your lines on a cream background. On a tablet, the browser may ask before it saves the file.

Does the page keep my programs?

Your program for each challenge stays while the page is open. Which challenges you have finished is saved in this browser on this device only. Nothing is sent anywhere.

Keep Exploring

Last reviewed: November 2026