Project Folders
Teacher Resources
Student Resources
How Do I?
Site Map
Our Team

squares 1 2 3 4 5 6 7
Squares 1
4 KB

Goal:   Draw a colored square.


Vocabulary:   pd, setc (setcolor), fd (forward), rt (right), cg

Project Map



We use words the turtle knows to teach it a new word: square.  

You might like to type each command in the command center and hit Enter/Return after each line to see the turtle draw a square line by line.   Then copy and paste the code into a square procedure on the Procedures tab.

  1. Hatch a turtle.

  2. pd means "pen down" so that the turtle will draw a line wherever it moves.

  3. Setc means "set color."   Setc 65 is a medium green.

  4. Fd 100 means, "Move forward 100 tiny turtle steps."

  5. Rt 90 means, "Turn right 90 degrees."

    (Why 90 degrees? There are 360 degrees in a circle.   The turtle ends up turning in a complete circle to come back where it started.   To make a square with right angles, the turtle turns 1/4 of the way at each corner of the square.   One quarter of 360 is 90.   You might like to see what happens if the turtle turns a different amount.   You could try a bit more than 90 degrees, or a bit less.)

  6. In the reset procedure, cg means "clear graphics."   It erases everything drawn on the page and returns the turtle home (at the very center of the page), facing up.

  7. Make a button with the instruction square.

  8. Make a reset button that calls the reset procedure.  

What If?
Try a different input (number) after each fd.
Try a different input (number) after setc.

Can you make a rectangle?
Can you make a square or a rectangle with a different color on each side?

On Your Own - Project Ideas
Can you make a simple colorful picture using just fd, rt, and the square procedure?

© copyright 2001 - 2016  OpenWorld Learning.   All rights reserved.