;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: ;;; ;;; Description: ;;; ; (define (draw) ; ; YOUR CODE HERE ; (exitonclick)) ; ; Please leave this last line alone. You may add additional procedures above ; ; this line. ; (draw) ; Draw a square. (define (square r) (fd r) (lt 90) (fd (* 2 r)) (lt 90) (fd (* 2 r)) (lt 90) (fd (* 2 r)) (lt 90) (fd r)) ; Draw a randomized shape. (define (paint shape size x y) (let ((dr (uniform 0.01 0.06)) (dg (uniform 0.01 0.06)) (db (uniform 0.01 0.06))) (define (strike size x y r g b) (if (and (> size 0) (> 0.95 (uniform 0 1))) (begin (pu) (setposition (+ x r) y) (pd) (color (rgb r g b)) (begin_fill) (shape size) (end_fill) (strike (- size 1) (- x 1) y (max 0.3 (- r dr)) (max 0.3 (- g dg)) (max 0.3 (- b db))) ))) (strike size x y (uniform 0.9 1) (uniform 0.9 1) (uniform 0.9 1)))) ; Draw an array of randomized shapes. (define (array x y) (begin (paint (choice (list circle square)) 50 x y) (cond ((and (> x 200) (> y 200))) ((> x 200) (array -200 (+ y 100))) (else (array (+ x 100) y))))) (define (draw) (hideturtle) (speed 0) (array -200 -200) ) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)