CSC151.02 2013F, Class 37: Randomized (Unpredictable) Drawing
=============================================================

_Overview_

* Admin.
* QUIZ!
* Random art.
* Why use randomness.
* The `random` procedure.
* Simulation.

_Admin_

* There will be time for questions on assignment 8, which is our last
  assignment.
* There's been a request that I talk about `vector-fill!`
* Next Friday we will be moving our class to the 3rd floor ARH lecture
  hall (302, I believe) to hear Hilary Mason '00.  Class starts at 12:45.
    * So no quiz next week
* Upcoming extra credit opportunities:
    * 6pm event in Main Quad
    * A love-your-body week event.
    * Drag show.  (Yes, this is in addition to the other lyb events.)
    * Basketball, Saturday, 3pm, Alumni
    * Concert, Saturday, 7:30, S-L.
    * Post-24-hour show, Saturday, 7:30, ???
    * Town Hall, Wednesday, November 13, noon or 7:30 p.m.
    * Learning from Alumni, Thursday: Atul Gupta, Trustee, 2:15-4:05
    * CS Extra, Thursday: Hilary Mason '00
    * CS Table, Next Friday, HCI
    * CLS with Hilary Mason '00, Friday, ???
    * Football, noon, a week from tomorrow
    * Digital Commons talk Monday, November 19, 7:00 p.m. or so

Question on Vector-Fill!

    ; Goal of vector-fill!: Fill an existing vector with a particular value
    > (define v (vector 1 2 3))
    > v
    '#(1 2 3)
    > (vector-fill! v 0)
    > v
    '#(0 0 0)

    ; An INCORRECT solution
    (define vector-fill!
      (lambda (vec val)
        (make-vector (vector-length vec) val)))
    ; This does not achieve the required goals.  Yes, it gives a vector
    ; of the required form, but it's a NEW vector.  (It doesn't mutate.)

    (define vector-phil!
      (lambda (vec val)
        (for-each (lambda (i) (vector-set! vec i val))
                  (iota (vector-length vec)))))
    
    (define vector-pfil!
      (lambda (vec val)
        (let kernel ([pos 0])
          (when (< pos (vector-length vec))
            (vector-set! vec pos val)
            (kernel (+ pos 1))))))

Does it make a difference if you iteratire from vector-length to 0 or from 0
to vector-length?  

> Not really, it depends on the problem.  Try one, see how well it works.    

Questions on Homework

Random art
----------

Why use randomness
------------------

The  procedure
--------------

Simulation
----------

