;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: A Warm Dive ;;; ;;; Description: ;;; It starts off as red ;;; and swirls to orange, but look! ;;; a centered bass clef. (define (draw) (draw-spiral 2 "#ff0000") (exitonclick)) ;draw a triangle with side-length size and colour col (define (draw-triangle size col) (color col) (begin_fill) (fd size) (right 120) (fd size) (right 120) (fd size) (right 120) (end_fill)) ;draw a spiral with starting size size and starting colour col (define (draw-spiral size col) (spiral-helper draw-triangle size col (* 0.015 size) (* 0.05 size) 1.09 0 120)) ; spiral-helper recursively draws a spiral by calling shape-func and drawing a shape ; then turning and moving ; and calling itself again with incremented values (define (spiral-helper shape-func size col right-by fd-by grow-by count limit) (if (= count limit) (shape-func size col) ((shape-func size col) (pu) (right right-by) (fd fd-by) (pd) (spiral-helper shape-func (* size grow-by) (make_yellower col) (+ right-by 0.3) (* fd-by grow-by) grow-by (+ count 1) limit)))) (speed 0) ; Please leave this last line alone. You may add additional procedures above ; this line. All Scheme tokens in this file (including the one below) count ; toward the token limit. (draw)