CSC151.01 2015S, Class 30: Other Forms of List Recursion
========================================================

* New partners!

_Overview_

* Preliminaries.
    * Admin.
    * Upcoming Work.
    * Extra Credit.
    * Questions.
* What's going on with `irgb-brightest`?
* Lab.

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

### Admin

* Friday the 13th falls on Friday this week.  Be careful!
* Review sessions 9am, 1:15pm, and 8:00pm Thursday.
    * I can answer general exam questions in the daytime sessions.
* Office hours again mostly normal (MTWF 10:00 plus afternoons).
    * <http://rebelsky.youcanbook.me>

### Upcoming Work

* [Exam 2](../assignments/exam.02.html).
    * Electronic version due 10:30 p.m. Thursday the 12th.
    * Epilogue due 11:00 p.m. on Thursday the 12th.
    * Printed version due start of class on Friday the 13th.
    * But I will make accommodations if you are over your head with work
      or life.
* Reading for Friday: 
    * [Numeric Recursion](../readings/numeric-recursion-reading.html)
* Quiz Friday!

### Extra Credit Opportunities

#### Academic 

* CANCELLED: Town Hall on Town Halls, noon or 7:30 p.m. today
* Amy Johnson '85 concert tonight at 7:30 p.m. in Herrick.
* CS Table Friday - Debrief from Tapia Celebration of Diversity in Computing
* Post-break: April 1 Scholars Convocation on Implicit Bias.

#### Peer Support (Morning Section)

* Julia's radio show, "The Hot Box".  Wednesday night/Thursday morning 
  1:00-2:00 a.m.  THAT'S TONIGHT.  Happy songs, because you need them.

### Questions

_Can you help me think about the tests in problem 6?_

> You will need to write tests that use particular colors, colors which
  you will normally create with `irgb`.

> Your main check is "Did `irgb-classify` classify it correctly?"

> For example

        (check-equal? (irgb-classify (irgb 200 201 200))
                      'greenish
                      "large, close, values; red=blue; green dominates")

_I'm getting a weird "quark" error in problem 8.  Can you tell me why_

> You are probably generating a y value outside of the valid range. 
  Try generating the list of y values and scanning it for negative numbers
  or values greater than height-1.

> Computers are sentient and malicious.

_How long is "long" for lists when we are checking `rdc` and `rac`?_

> 10,000 or so would be good to test.

What's going on with `irgb-brightest`?
--------------------------------------

    (define irgb-brightest
      (lambda (colors)
        (cond
          [(null? (cdr colors))
           (car colors)]
          [(>= (irgb-brightness (car colors)) 
               (irgb-brightness (irgb-brightest (cdr colors))))
           (car colors)]
          [else
           (irgb-brightest (cdr colors))])))

Lab
---

The pattern you choose is important!

Please do NOT use the following form

        (define largest
          (lambda (lst)
            (cond
              [(null? (cdr lst))
               (car lst)]
              [(max (car lst) (largest (cdr lst)))])))

* Why not?
    * Only two choices: Use an if expression
    * Always put `else` before your default
* So write

        (define largest
          (lambda (lst)
            (if (null? (cdr lst))
                (car lst)
                (max (car lst) (largest (cdr lst))))))

Pun of the day

* Instead of `irgb-all-bright?` you can write `irgb-madeleine?`
