;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Sunflower ;;; ;;; Description: ;;; Upvote if you're a ;;; Beautiful strong sunflower ;;; Who don't need no sun (define (sgoto x y) (penup) (goto x y) (pendown)) (define (rect w l x y) (sgoto x y) (goto x (+ w y)) (goto (+ x l) (+ y w)) (goto (+ x l) y) (goto x y)) (define (drawleaf) (color 'darkgreen) (begin_fill) (circle 50 65) (left 110) (circle 50 65) (end_fill)) (define (flower) (color 'yellow) (begin_fill) (define (iter i) (if (= i 13) (end_fill) (begin (circle 25 120) (circle 7 180) (right 90) (circle 25 120) (iter (+ 1 i))))) (iter 1)) (define (drawborder i) (if (= i 8) nil (begin (if (= (modulo i 2) 0) (color 'red) (color 'black)) (rect (- 400 (* 2 i)) (- 400 (* 2 i)) i i) (drawborder (+ i 1))))) (define (drawcloud r) (color 'white) (begin_fill) (define (iter i) (if (= i 15) (end_fill) (begin (if (or (= i 2) (= i 6) (= i 9) (= i 13)) (begin (circle r 180) (rt 90)) (begin (circle r 180) (rt 150))) (iter (+ i 1))))) (iter 1) ) (define (draw) ; first draw background (color 'green) (begin_fill) (rect 200 400 0 0) (end_fill) (color 'skyblue) (begin_fill) (rect 200 400 0 200) (end_fill) ; draw border (drawborder 0) ; draw leaves (sgoto 230 140) (seth 120) (drawleaf) (sgoto 230 130) (setheading 300) (drawleaf) ; draw stem (color 'darkgreen) (begin_fill) (rect 150 10 225 45) (end_fill) ; flower (sgoto 250 250) (seth 90) (flower) (sgoto 230 195) (color 'brown) (begin_fill) (circle 30) (end_fill) ; clouds (sgoto 100 330) (seth 330) (drawcloud 9) (sgoto 340 350) (seth 330) (drawcloud 7) (exitonclick)) ; should have 251 tokens or less, depending on whether quote counts as a delimiter or not ; or if I messed up terribly while counting ; 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)