CSC104H1 Lecture Notes - Lecture 7: Animage

28 views4 pages
26 Sep 2016
School
Course

Document Summary

; repeated : function any number list. ; produces (list start (function start) (function (function start)) ) ; with length times". (define (repeated function start times) (cond [(= times 1) (list start)] [else (list* start (repeated function (function start) (- times 1)))])) (define goldie. ; cut off her nose: (check-expect (crop-right goldie 10) ; grab her nose: (check-expect (crop-left goldie (- (image-width goldie) 10)) ) ; put her back together wrong: (check-expect (beside (crop-left goldie (- (image-width goldie) 10)) (crop-right goldie 10)) ; let"s make a function to do that. ; design: (check-expect (scroll-right goldie) (beside (crop-left goldie (- (image-width goldie) 10)) (crop-right goldie 10))) ; scroll-right : image image (define (scroll-right an-image) ; the freeze" function throws away information about how the image was created, ; the to-draw" clause can take a width and height for the animation window. ; the following is if you"re curious about the freeze" function, but is not required material.

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