CSC151.02 2016S, Class 36: Randomized (Unpredictable) Drawing
=============================================================

_Overview_

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

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

### Admin

* Continue partners.
* I will continue to bring you food (or food-like substances) until I am 
  caught up on grading.
* Yay!  The College got money.
* Friday PSA.

### Reminders

* Office hours this week 
    * See http://rebelsky.youcanbook.me.
    * Ask me about other available times.
* Tutor hours
    * Sunday, 3-5 p.m.
    * Sunday-Thursday, 7-10 p.m.

### Upcoming Work:

* Reading for Monday: 
   * [Pairs and Pair Structures](../readings/pairs-reading.html)
* Lab Writeup:
    * Send email titled __CSC 151 Lab Writeup 36 (Your Names)__
    * Do not include the underscores.
    * Send to <CSC151-02-grader@grinnell.edu>
    * Due before class on Tuesday.
* Exam prologue due tonight
* Exam due Tuesday

### Extra Credit

* Send your reports to <rebelsky@grinnell.edu> with subject 
  "CSC 151 Extra Credit".  (Do not include the quotation marks.)
* Send opportunities to me before class with subject
  "CSC 151 EXTRA CREDIT OPPORTUNITY!"

#### Academic / Artistic

* BAX TODAY, 4pm, Bucksbaum.
* Next week's celebration of student scholarship.

#### Peer

* Fun Japanese Spring Festival TONIGHT at 7pm.  Origami and food!
* Game Dev Class Demos, Monday, 2-3 pm, DLab.  Free food!

#### Miscellaneous

* Pioneer weekend. THIS WEEKEND.  Business hack-a-thon.
* Host a prospective student.

#### Regular Peer 

* Social Dance Workshop Tuesdays 7:00-8:00 in Bucksbaum Dance Studio
* Post-break ExCo on British Politics Wednesdays at 8:00 in JRC 203.  
  Just show up; you don't need to sign up.
* Pun club Saturdays at 4pm in Younker 
* Electronic Potpourri on KDIC Fridays at Five 
* Space Odyssey KDIC Fridays at Six
* Bollywood, Fridays, 7:30-8:30, Younker
* Effective Altruism club, 2:30-3:30 Sundays in JRC 226.

#### Misc

#### Far in the Future

* Lords of the Flies, April (maybe the 22nd).
* Adaptation of Rushdie's East West.  Early May.

### Other Cool Stuff

* Mission Creek Festival in Iowa City has some cool talks about technology
  and the arts, <http://missionfreak.com>.

### Questions

_I really want to take the awesome-sounding one-credit course entitled "Social Justice Issues Influencing American Business".  But it overlaps with 151.  Can I miss four sessions without penalty?_

> Yes, provided you make up the labs on your own.

_I'd really like to take CSC 207 in the fall.  Is it possible to do 161 over the summer?_

> We provide two alternate tracks for 161 over the summer.  Neither counts toward the 32 credits in the major, but they do allow you to go on to 207.

> You can take the Harvard CS 50 course on EdX.
  <https://www.edx.org/course/introduction-computer-science-harvardx-cs50x>

> You can use the pre-robots version of CSC 161 and have me give you a
  test at the end of the summer.  
  < http://www.cs.grinnell.edu/~walker/courses/161.sp10/>

> I'll do my best to answer questions in either context.

> We have about a 50% success rate for either option.

_Is grading done yet?_

> No.  It appears that all the signs that Minna posts about sleep are
  correct.

_Monday?_

> I certainly hope so.

_Have people started asking good questions about the exam?_

> Yes.

_Can you go over some of them?_

> Maybe.

_I need more than one consequent in an `if` statement.  What do I do?_

> Use `cond` or `when`.

_I don't need an alternate in an `if` statement.  What do I do?_

> Use `when`.

_Can I use `list-drop` or `list-take` in solving `rdc` or `rac`?_

> No.

_Can cond really do more than one step?_

        (define process-list
          (lamda (lst)
            (cond
              [(null? lst)
               (void)]
              [(odd? (car lst))
               (display "It strikes me that ")
               (display (car lst))
               (display " is somewhat odd")
               (newline)
               (process-list (cdr lst))]
              [else
               (process-list (cdr lst))])))

_Can you do an example of a named let really quick?_

> Form

        (let NAME ([PARAM INIT-VALUE]
                   [PARAM INIT-VALUE])
          BODY)

> Example

        (define tally-odd
          (lambda (lst)
            (let colonel ([tally 0]
                          [remaining lst])
              (cond
                ; NOTHING LEFT
                [(null? remaining)
                 tally]

                ; ODD CAR
                [(odd? (car remaining))
                 (colonel (+ 1 tally)
                          (cdr remaining))]

                ; EVEN CAR
                [else
                 (colonel tally (cdr remaining))]))))
          BODY)
              
Quiz
----

Lab
---

Writeup is 1b.

But you should play with the rest of the lab; it's fun (and may even
help you on the exam).
