Last active
August 29, 2015 14:03
-
-
Save amonks/0b979c093d349411059a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;here's the main function, it uses 'map' which we define below | |
(define (make-circles list-of-colors) | |
(my-map (lambda (color) | |
(circle 12 'solid color)) | |
list-of-colors | |
)) | |
;replacement for built-in 'map' function | |
(define (my-map f lst) | |
(cond | |
[(empty? lst) empty] | |
[else (cons (f (first lst)) | |
(my-map f (rest lst)))])) | |
;handy list of colors so we can do (make-circles colors) instead of writing it out | |
(define colors | |
(list "red" "green" "blue" "yellow") | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment