;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Golden Bear Ratio ;;; ;;; Description: ;;; Fibonacci trace ;;; Seen throughout nature but wait ;;; Golden Bear Ratio (define (draw) (define (golden-ratio starting-turns) (setheading 270) (define (draw-turn turns-left length) (if (not (= turns-left 0)) (begin (if draw-box-time (begin (color box-color) (draw-box length) (color spiral-color) ) ) (circle length 90) (draw-turn (- turns-left 1) (* length 1.618)) ) ) ) (draw-turn starting-turns 4.2358) ) (define (draw-box length) (define (draw-side sides-left) (if (not (= sides-left 0)) (begin (forward length) (left 90) (draw-side (- sides-left 1)) ) ) ) (draw-side 4) ) (define (redraw n-times draw-function n-steps) (define (draw-down times-left) (if (not (= times-left 0)) (begin (pu) (setposition (+ 50 times-left) (+ 110 times-left)) (pd) (draw-function n-steps) (if (= times-left (/ n-times 2)) (set! draw-box-time #f)) (draw-down (- times-left 1)) ) ) ) (draw-down n-times) ) (define draw-box-time #t) (define box-color '"#F8F9F9") (define spiral-color '"#fdb515") (bgcolor '"#15284b") (color spiral-color) (speed 0) (pu) (setpos 50 110) (pd) (redraw 20 golden-ratio 10) (hideturtle) (exitonclick)) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)