EBoard 29: SoLA 3

This class will be recorded! Its use is limited to members of the class. Please do not share with others.

Approximate overview

  • Administrative stuff [~5 min]
  • Q&A [~85 min]

Administrative stuff

Notes and News

  • I’ve been told that you should never share new technologies with old faculty; they really don’t understand how to use them.
  • Today’s class is optional. I hope to see some of you here today.

Upcoming activities and other token-earning things

Events

  • Visit Grinnell Art Museum, maybe get an art pack https://www.grinnell.edu/campus-life/arts-culture/museum.
  • CS Extras, TODAY at 5pm. It should be awesome.
  • Mentor Session, Sunday, 1pm, review the SoLA, prep the next one.
  • Monday, CS Table at noon

Upcoming work

I’m not sure if all of these links are correct. Let me know if any are not.

  • [Reading response for Friday]
  • [Lab writeup]
  • Mini-project 6 due next Monday.
    • Our last mini-project.
  • SoLA 3 is live NOW!
  • SoLA 4 next Thursday
    • 48 hours, until 3pm Saturday
    • Please show up for the first thirty minutes.
    • The sooner you do it, the sooner you’ll get grades back.

Q&A

Sam will gather questions, group them, and then try to answer them.

Sample SoLA

Can we go over the mental model problem?

  • At the top level, we have a four-element list, which I could build with cons or with list.
(cons "a" 
      (cons (cons (cons (cons null  
                              "b")
                        null)
                  (cons null
                        (cons (cons "c" "d") 
                              null)))
            (cons "e" 
                  (cons "f" 
                        null))))

Can we go over the randomness problem?

It may be helpful to use some of the randomness helpers we had already.a

;;; Procedure:
;;;   random-elt
;;; Parameters:
;;;   lst, a non-empty list 
;;; Purpose:
;;;   Unpredictably pick an element of lst.
;;; Produces:
;;;   val, a value
;;; Preconditions:
;;;   [No additional]
;;; Postconditions:
;;;   * val is an element of lst.
;;;   * If lst contains more than one element, it is difficult to predict 
;;;     which element val is.
(define random-elt
  (lambda (lst)
    (list-ref lst (random (length lst)))))

And what we did there seems relevant: A random this, then a random that, then a random other thing.

``` (define vowels (list “A” “E” “I” “O” “U”)) (define consonants (list “B” “C” “D” “F” “G” “H” “J” “K” “L” “M” “N” “P” “Q” “R” “S” “T” “V” “W” “X” “Y” “Z”)) (define random-id (lambda () (string-append (random-elt consonants) (random-elt vowels) (random-elt consonants) (random-elt vowels) (random-elt consonants) (random-elt vowels))))