;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Turtles All the Way Down ;;; ;;; Description: ;;; Spiral of turtles ;;; It's turtles all the way down ;;; In "turtle graphics" ;;; ;;; Note: Turtles all the way down is a humorous response to the inifinite regress problem. Read more about it at http://en.wikipedia.org/wiki/Turtles_all_the_way_down (define (draw) (speed 0) (ht) (penup) (goto 300 0) (pendown) (spiral 300) (exitonclick)) (define (spiral radius) (if (> 30 radius) () (begin (circle radius 90) (right 90) (turtle (/ radius 300)) (circle radius 90) (right 90) (turtle (/ radius 300)) (spiral (- radius 25))))) (define (turtle size) (color "green") (begin_fill) (circle (* -15 size)) (end_fill) (right 90) (penup) (fd (* 8 size)) (left 90) (fd (* 3 size)) (pendown) (color "black") (begin_fill) (circle (* 2 size)) (end_fill) (color "green") (fd (* -3 size)) (right 90) (fd (* 7 size)) (begin_fill) (right 45) (fd (* 20 size)) (right 90) (fd (* 7 size)) (right 90) (fd (* 20 size)) (right 90) (fd (* 7 size)) (end_fill) (right 90) (fd (* 20 size)) (right 90) (fd (* 3.5 size)) (left 45) (penup) (fd (* 14 size)) (right 90) (fd (* 3 size)) (left 90) (pendown) (begin_fill) (circle (* 30 size) -180) (end_fill) (left 90) (fd (* 10 size)) (begin_fill) (left 90) (fd (* 10 size)) (right 90) (fd (* 10 size)) (right 90) (fd (* 10 size)) (end_fill) (left 90) (fd (* 20 size)) (begin_fill) (left 90) (fd (* 10 size)) (right 90) (fd (* 10 size)) (right 90) (fd (* 10 size)) (end_fill) (right 90) (fd (* 50 size)) (left 90) (scales 0 size) (penup) (left 90) (fd (* 46 size)) (left 34) (fd (* -30 size)) (left 146) (fd (* 27 size)) (right 90) (fd (* 14 size)) (right 45) (fd (* 3.5 size)) (left 90) (fd (* 20 size)) (left 45) (fd (* 15 size)) (pendown)) (define (scales n size) (if (> 5 n) (begin (color "#0f390f") (begin_fill) (circle (* 6 size) 180) (end_fill) (left 180) (scales (+ 1 n) size)) (if (= 5 n) (begin (penup) (right 90) (fd (* 30 size)) (left 16) (fd (* 30 size)) (pendown) (begin_fill) (left 74) (circle (* 6 size) 180) (end_fill) (scales (+ 1 n) size)) (if (> 9 n) (begin (penup) (right 90) (fd (* 3 size)) (right 90) (pendown) (begin_fill) (circle (* 6 size) 180) (end_fill) (scales (+ 1 n) size)) (if (= 9 n) (begin (penup) (left 90) (fd (* 57 size)) (left 16) (fd (* -30 size)) (left 18) (fd (* 30 size)) (pendown) (begin_fill) (left 56) (circle (* 6 size) 180) (end_fill) (scales (+ 1 n) size)) (if (> 12 n) (begin (penup) (right 90) (fd (* 5 size)) (right 90) (pendown) (begin_fill) (circle (* 6 size) 180) (end_fill) (scales (+ 1 n) size)))))))) ; 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)