Session 8 Preparation — Videos, Reading and Quizzes

Quizzes:

Do this Quiz on Session 8 as you watch the videos and do the reading (as listed below). This document is a Microsoft Word document; here is the same Quiz on Session 8 (pdf) as a PDF.

You can either:

In either case, bring paper copy of the completed quiz to your Session 8 class.

Videos and Reading (online and textbook):

All of the following are required except the items labeled Optional are, well, optional (i.e., things that may be interesting but do not directly pertain to your success in this course).

  1. Exam preparation documents
  2. The Wait Until Event Pattern and WHILE Loops
    • Video:
      • Video (embedded in a web page) [7:34 minutes]
      • Video (as an mp4 that you can download if you want)
    • Textbook reading: Section 4.1 — The WHILE Loop (pages 156 - 162, 7 pages) and Section 4.3 — Application: Processing Sentinel Values (pages 166 - 169, 4 pages)

      The above video and reading cover much the same material, but with two very different presentations. Choose what works best for you. In the reading, focus your attention on:

      • The concept of looping until a condition is false, per the nice example in Figure 2 on page 158.
      • The notation for WHILE statements, per Syntax 4.1 on page 157.
      • The distinction between count-controlled loops (sometimes called definite loops) and event-controlled loops (sometimes called indefinite loops).
        • Count-controlled loops are typically implemented by using FOR loops, as we have been doing since Session 3.
        • Event-controlled loops are loops per the wait-until-event pattern described in the video. These are typically implemented by using WHILE loops.
      • The concept of a sentinel — an input that signals the end of input (and is not itself real data).

      Aside: There are two basic approaches to event-controlled loops when it is wrong to check the condition as the first act in the loop. The video presents one style, the textbook another; either is fine. Special Topic 4.1 acknowledges the video's style, in its discussion of using a break statement to implement a loop and an half.

  3. Hand-Tracing

    Textbook reading: Section 4.2 — Problem Solving: Hand-Tracing (pages 163 - 165, 3 pages).

    You will do hand-tracing on your first test; this section is a nice example of the “how-to's” for doing so.

  4. The Create Robot Library
    • Video (embedded in a web page) [9:10 minutes]
    • Video (as an mp4 that you can download if you want)

    Note: This video is slightly out of date in several small respects:

    • The new create library is new_create. Import the new library, not the old one.
    • You no longer need to do a robot.toFullMode() when constructing a robot — full mode is now the default mode.
    • You can get the sensor strings by using new_create.Sensors.BLAH. This is a better approach than trying to guess (or look up) a sensor string.
    Also: The video uses the square bracket [] notation for songs. We will study that notation soon; meanwhile, just gloss over it.
  5. Making your own PyDev Projects and Modules