CSC104H1 Lecture Notes - Lecture 7: Animage

29 views5 pages
26 Sep 2016
School
Course

Document Summary

; repeated : function any number list. ; (repeated f a n)" produces (list a (f a) (f (f a)) )" with n" elements. (define (repeated f a n) (cond [(= n 1) (list a)] [else (list* a (repeated f (f a) (- n 1)))])) (require picturing-programs) ; here"s a function that does nothing to an image. ; leave-alone : image image (define (leave-alone an-image) an-image) (check-expect (repeated leave-alone. 5) (list (leave-alone (leave-alone (leave-alone (leave-alone (leave-alone (leave-alone (leave-alone (leave-alone (leave-alone (leave-alone (check-expect (repeated leave-alone. ; by doing nothing in the on-tick" transformation we can see the isolated effect of the to-draw". ; for example, putting flip-vertical" in the to-draw" will show the unchanging star upside-down. ; recall that it"s like doing a map": (check-expect (map flip-vertical (repeated leave-alone. 5)) (map flip-vertical (list (check-expect (map flip-vertical (repeated leave-alone. 5)) (list (flip-vertical (flip-vertical (flip-vertical (flip-vertical (flip-vertical (check-expect (map flip-vertical (repeated leave-alone.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents