| Presentations | ||||||||||||
For your lectures, focus on the high-level parts of the assigned material. Illustrate it with illustrative examples of your own choice. The examples will demonstrate how well you have understood the material and how well you can explain it to others. The homework presentations have the following general structure. The two partners must show up together at the schedule time. For each partner, the TAs will randomly choose a solution for a required problem and open it with DrScheme:
During our first meeting, two TAs presented the solution for the 'reveal' problem from HtDP (page 78). Their solution contained far more comments than we expect from you for your solutions. In particular, there is no need to include the templates in the solution files. An ideal student solution is appended below. While their presentation was excellent and insightful for your current status, the TA's code suffered from two flaws:
;; -----------------------------------------------------------------------------
(define-struct word (a b c))
;; Word = (make-word Letter Letter Letter)
;; Letter is one of: 'a ... 'z '_
;; -----------------------------------------------------------------------------
;; Word Word Letter -> Word
;; does the guess occur anywhere in the guess word? reveal via new status word
(check-expect (reveal (make-word 'c 'a 't) (make-word '_ 'a '_) 'c)
(make-word 'c 'a '_))
(check-expect (reveal (make-word 'c 'a 't) (make-word '_ 'a '_) 'a)
(make-word '_ 'a '_))
(check-expect (reveal (make-word 't 'o 'o) (make-word '_ '_ '_) 'o)
(make-word '_ 'o 'o))
(define (reveal chosen status guess)
(make-word
(compare (word-a chosen) (word-a status) guess)
(compare (word-b chosen) (word-b status) guess)
(compare (word-c chosen) (word-c status) guess)))
;; -----------------------------------------------------------------------------
;; Letter Letter Letter -> Letter
;; if chosen letter is guess letter, produce it; otherwise chosen
(check-expect (compare 'a 'a 'c) 'a)
(check-expect (compare 'c '_ 'c) 'c)
(check-expect (compare 'c '_ 'd) '_)
(define (compare chosen status guess)
(cond
[(symbol=? chosen guess) guess]
[else status]))
| |||||||||||||
| last updated on Tue Jun 9 22:21:18 EDT 2009 | generated with PLT Scheme |