Outline for October 22, 2012

Reading: None
Assignment Due: October 24, 2012 at 5:00PM

  1. Turtle graphics
    1. What turtle is; import turtle
  2. Drawing a figure: a box with a hat [tbox.py]
    1. Set up the window to draw in: Screen()
    2. Create the turtle:Turtle
    3. Cursor for drawing
    4. Move cursor forward: forward, backward()
    5. Turn cursor: left(), right()
    6. Wait for the window to close: mainloop()
  3. Titles, background, and such [tfancybox.py]
    1. Window<
      1. Color of the window background: background()
      2. Title of the window: title
    2. Turtle, more properly called “pen”
      1. Shape of the turtle: shape()
      2. Speed of the drawing: speed()
      3. Color of the drawn line: color()
      4. Thickness of the line (pixels): pensize()
      5. Hide the turtle: hideturtle()
  4. Plotting points and graphing
    1. Drawing lines: penup(), pendown()
    2. Move turtle: setpos()
    3. Write text: write()
    4. Draw a dot at the current position: dot() [tchaos1.py]
    5. Draw a line from the current position to another: goto() [tchaos2.py]

A PDF version is available here.
ECS 10, Basic Concepts of Computing
Fall Quarter 2012