Session Details

Week 1, Session 2 — Thu Dec 2

Prep

  1. Zelle, §1.3, 1.5–2.4

HW Due

  1. HW 1

Topics

  1. Basic program structure
  2. The input/compute/output pattern
  3. Defining functions without parameters
  4. Printing versus returning a value
  5. Constructing objects
  6. Using objects: dot notation for methods and instance variables
  7. zellegraphics as an example of constructing and using objects
  8. Robots — introduction to physical properties of the iRobot Create

Outline

  1. [10 minutes] Roll call of about 1/3 of the students (repeat another third at the next session). Angel for attendance. Questions?
  2. [3 minutes] Review the chaos.py program.
  3. [17 minutes] Review and practice: the input-compute-output pattern. Modules:
  4. [20 minutes] Defining a function versus calling a function. Modules:
  5. [5 minutes] Check that zellegraphics is installed correctly. Fix if not. Choose robot partners for today.
  6. [5 minutes] Break, fix zellegraphics if necessary, catch-up. Bring out the robots.
  7. [25 minutes] Introduction of objects, using zellegraphics as the example. Modules:
  8. [15 minutes] The iRobot Create. Demo. Introduce its hardware. (Next session: programming them.)
  9. [5 minutes] Explain how to find homework, how to do homework, when due, where to get help. Put robots back in cabinets. Questions?

Resources

  1. Slides: Functions, Objects and Methods
  2. Zellegraphics Library API: A Python module for doing cool graphics — simple graphics, but very easy to learn

HW Assigned

  1. HW 2