In today's lecture, professor used DrrRacket to make snowflake and some other fun patterns.
Today's course is all about recursion.
Here is a function, koch is make the one thrid of a snowflake
The result for (koch 1) is
_/\_
Moreover, professor showed us another program, caleld "koch-snowflake
(define (koch-snowflake d)
(above
(beside
(rotate 60 (koch d))
(rotate -60 (koch d)))
(rotate 180 (koch d))))
The result of this progam will form a complete snowflake by putting three "koches" (three 1/3 of a snowflake) together like a triangle.
No comments:
Post a Comment