Forest Wiki: Learn Web Development in the Browser
Turtle Graphics
Draw a Line or Shape

Draw a Line or Shape




The Problem Statement

The goal of this exercise is to draw polygons.  We start you off with a program to draw a line.  It is always easiest to start with woking code..     The first thing to draw is a square, then you can draw more complex polygons.      Just turn left or right 90 degrees, and go forward.    

                                  Types of Quadrilaterals and Other Polygons - YouTube

 Here is a basic program to draw a line  In software it  very important to start with something that works.  Please modify it to draw polygons. the following commands may be useful. 

t.left(30) #turn to the left 30 degrees

t.right(-30) #Also turns to the left 30 degrees. 

Everyone please log in and save your work.   We will see who does the best design in the time allocated.  We can then show the best solutions 

 

 

Starting Source Code