CSC104H1 Lecture Notes - Lecture 11: Animage, Inside Out Music

49 views8 pages
School
Course
Professor

Document Summary

Because the width and height of s1 is both doubled by adding one triangle beside and one on top of the original one. So we scale it by to return to the original size) (define s1 (scale (above s0 (beside s0 s0)))) Nice: o (cid:455)ou repeat these steps to (cid:272)reate a (cid:373)ore (cid:272)o(cid:373)pli(cid:272)ated fra(cid:272)tal . (define s2 (scale (above s1 (beside s1 s1)))) (define s3 (scale (above s2 (beside s2 s2))): computer scientists are impatient to do all these repetitive stuffs all the time. So, whenever you find yourself repeating what you do over and over, consider designing a new function. A full design check-expect is a check-e(cid:454)pe(cid:272)t that (cid:455)ou do(cid:374)"t just t(cid:455)pe i(cid:374) the expression and its outcome, but all the procedure behind this outcome. Eg. not full design: (check-expect (stack s2) s3) Full design gives insight to the body of the function (check-expect s3 (scale (above s2 (beside s2 s2))))

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