lines-circles-squares

=Drawing Lines= code from turtle import * setup title("line program") turtle = Turtle
 * 1) line.py
 * 2) Draws a line using Python Turtle Graphics
 * 3) January 3, 2011
 * 4) Copyright 2009-2011 National Academy Foundation. All rights reserved.
 * 5) set up the program
 * 6) import turtle drawing routines
 * 1) set up the program
 * 2) import turtle drawing routines
 * 1) import turtle drawing routines
 * 1) import turtle drawing routines
 * 1) create the drawing window
 * 1) create a title for the drawing window
 * 1) create a turtle to draw with

turtle.up turtle.goto(-200,100) turtle.down turtle.color("black") turtle.width(3) turtle.forward(300)
 * 1) draw the line
 * 2) lift the pen up (away from the window)
 * 3) so it doesn't draw a line as it moves
 * 1) lift the pen up (away from the window)
 * 2) so it doesn't draw a line as it moves
 * 1) set the starting point for the drawing pen
 * 1) put the pen down (against the window) so it can begin to draw
 * 1) set the pen color
 * 1) set the pen width
 * 1) draw the line

turtle.hideturtle
 * 1) hide the turtle
 * 1) hide the turtle

done
 * 1) end the program
 * 1) end the program

code =Drawing Squares= code from turtle import * setup title("square program") turtle = Turtle
 * 1) square.py
 * 2) Draws a square using Python Turtle Graphics
 * 3) January 3, 2011
 * 4) Copyright 2009-2011 National Academy Foundation. All rights reserved.
 * 5) set up the program
 * 6) import turtle drawing routines
 * 1) set up the program
 * 2) import turtle drawing routines
 * 1) import turtle drawing routines
 * 1) import turtle drawing routines
 * 1) create the drawing window
 * 1) create a title for the drawing window
 * 1) create a turtle to draw with

turtle.up turtle.goto(-100,150) turtle.down turtle.color("green") turtle.width(2) turtle.forward(200) turtle.right(90) turtle.forward(200) turtle.right(90) turtle.forward(200) turtle.right(90) turtle.forward(200)
 * 1) draw the square
 * 2) lift the pen up (away from the window)
 * 3) so it doesn't draw a line as it moves
 * 1) lift the pen up (away from the window)
 * 2) so it doesn't draw a line as it moves
 * 1) set the starting point for the drawing pen
 * 1) put the pen down (against the window) so it can begin to draw
 * 1) set the pen color
 * 1) set the pen width
 * 1) go forward (to the right) 200px
 * 1) turn right 90 degrees

turtle.hideturtle
 * 1) hide the turtle
 * 1) hide the turtle

done
 * 1) end the program
 * 1) end the program

code =Drawing Half Circles= code format="python" from turtle import * setup title("half_circle program") turtle = Turtle
 * 1) half_circle.py
 * 2) Draws a half circle using Python Turtle Graphics
 * 3) January 3, 2011
 * 4) Copyright 2009-2011 National Academy Foundation. All rights reserved.
 * 5) set up the program
 * 6) import turtle drawing routines
 * 1) set up the program
 * 2) import turtle drawing routines
 * 1) import turtle drawing routines
 * 1) create the drawing window
 * 1) create a title for the drawing window
 * 1) create a turtle to draw with

turtle.up turtle.goto(0,20) turtle.down turtle.color("blue") turtle.width(6) turtle.circle(50,180)
 * 1) draw the half circle
 * 2) lift the pen up (away from the window)
 * 3) so it doesn't draw a line as it moves
 * 1) lift the pen up (away from the window)
 * 2) so it doesn't draw a line as it moves
 * 1) set the starting point for the drawing pen
 * 1) put the pen down (against the window) so it can begin to draw
 * 1) set the pen color
 * 1) set the pen width
 * 1) draw the half circle

turtle.hideturtle
 * 1) hide the turtle
 * 1) hide the turtle

done
 * 1) end the program
 * 1) end the program

code