CSC151.02 2015S, Class 23: Revisiting Lists
===========================================

* Continue partners.
* Food?  (optional)
* Fun with HW 5.

_Overview_

* Preliminaries.
    * Admin.
    * Upcoming Work.
    * Extra Credit.
    * Questions.
    * Quiz.
* Lab.

Preliminaries
-------------

### Admin

* Review session Monday at 7:00 p.m.
* One of your classmates passed along the following article which you
  might find interesting. 
    * <http://www.wired.com/2015/02/science-one-agrees-color-dress/>
* Prospies Monday!  Be prepared for special activities.
* Friday PSA
    * In making choices this weekend, please make sure that Nobody Gets
      Hurt (including you).
    * There are a lot of illnesses going around campus.  Rest will help
      you avoid them better than almost anything.  (I'm telling myself
      the same thing.)

### Upcoming Work

* [Homework 6](../assignments/assignment.06.html).  Is optional.
    * Due Tuesday at 10:30 p.m.
    * Replaces lowest HW, provided it is higher than the lowest.
* Exam 2 to be assigned on Tuesday.
* No lab writeup for today.
* Reading for Monday: Recursion Basics
    * [Recursion Basics](../readings/recursion-basics-reading.html)
    * A cool and different topic that we'll be talking about through
      spring break (and the rest of the semester).

### Extra Credit Opportunities

#### Peer Support (Afternoon Section)

* Indoor Track Today and Saturday.  Support Grinnell Pride!
* Belly Dancing 3:30-5:00 p.m. and Wednesday 7:00-8:00 p.m.

### Other Good Things

* Neverland Players this weekend.
* Spend thirty minutes going to the thing at Garander tonight at 10:00 p.m.
* Stephen Hawking movie tonight 6pm and 9pm in Harris Cinema.
* Today is last day of Amy Flores show in Smith.

### Questions

### Quiz!

* When you finish, keep your paper by you.  We will be by to pick it up.
* When you finish, start GIMP and DrRacket and look over the lab, but
  wait for your partner.

Lab
---

* `cons` can build things that aren't lists.  You only get a list if
  the second parameter is a list.
* Scheme/Racket show you non-list pair structures by including a period
  somewhere (traditionally right before the end).
* (cdr (cons a b)) is always b
* (car (cons a b)) is always a
* Lots of pronounciation: cadr, cddr, cadadr

Learning Outcomes
-----------------

* How to build and disamble lists with cons, car, and cdr.
* We can use a list to represent a group of related information
    * The description of a drawing
    * The description of a class '('CSC 151 2 "Functional Problem Solving" 1)

* If we know that representation, we can build procedures that construct things to match it or that deconstruct things to use them.

HW5, Revisited
--------------

* You have written `(image-sample image x-coordinates y-coordinates)`.
* You could also have written `(image-sample image shape xs ys)`.
* It's easy to generate long lists of xs and ys
    * `(map (lambda (i) (modulo (* i 11) (image-width image))) (iota 1000))` 
    * `(map (lambda (i) (modulo (* i 13) (image-heightimage))) (iota 1000))` 
    * Putting it all together, we can get some great pictures.

        
