;; The first three lines of this file were inserted by DrScheme. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-beginner-reader.ss" "lang")((modname circles) (read-case-sensitive #t) (teachpacks ((lib "testing.ss" "teachpack" "htdp") (lib "guess.ss" "teachpack" "htdp") (lib "master.ss" "teachpack" "htdp") (lib "draw.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "testing.ss" "teachpack" "htdp") (lib "guess.ss" "teachpack" "htdp") (lib "master.ss" "teachpack" "htdp") (lib "draw.ss" "teachpack" "htdp"))))) ;; concentric-circles: posn, number, number, color, color -> boolean ;; The function draws a series of concentric circles of ;; alternatining colors (color1, color2) with the center ;; given by the parameter center, the largest radius given by ;; radius (>= 0), the smallest radius given by min-radius, the ;; outer color given by color1. The radius of the next circle is ;; 20 pixels less than of the current one (define (concentric-circles center radius min-radius color1 color2) (cond [(< radius min-radius) true] [else (and (draw-solid-disk center radius color1) (concentric-circles center (- radius 20) min-radius color2 color1))] ) ) (start 400 400) (concentric-circles (make-posn 200 200) 200 20 'red 'blue)