;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: ;;; ;;; Description: ;;; ;;; ;;; p.s. : it's hard to see but the flowers on each branch represent the fibonacci number ;;; you can see it clearly when you just draw one tree (define (draw) (define (repeat k fn) (if (> k 0) (begin (fn) (repeat (- k 1) fn)))) (define sky (lambda () (penup) (setpos 800 500) (pendown) (color "#e6ffff") (pendown) (begin_fill) (seth 180) (fd 400) (rt 90) (fd 1600) (rt 90) (fd 400) (end_fill))) (define road (lambda () (penup) (setpos (- 495) (- 407)) (begin_fill) (color "#666666") (pendown) (seth 43) (fd 700) (rt 47) (fd 20) (rt 47) (fd 700) (end_fill))) (define (fib n) (if (< n 3) 1 (+ (fib (- n 1)) (fib (- n 2))))) (define (draw-flowers size stem) (color "#331a00") (pensize size) (pendown) (fd (* stem size)) (color "#faafba") (pensize (* size 5))(lt 36) (begin_fill) (pensize size) (color "#fee7ea") (repeat 5 (lambda () (penup) (fd (* 2.5 size)) (rt 90) (pendown) (circle (* 4.5 size) 360) (penup) (lt 90)(bk (* size 2.5)) (lt 72))) (color "#faafba")(end_fill) (rt 36) (color "#f778a1")(fd (* size 5)) (rt 162) (repeat 5 (lambda () (pendown) (fd (* size 10)) (rt 144))) (penup) (color "#ffcc00")(lt 162) (bk (* size 6)) (rt 90) (pensize (* size 3)) (pendown) (circle size 360)(lt 90)(penup) (bk (* size stem))) (define (multiple-flowers size num) (rt 90) (if(< num 6) (repeat num (lambda () (lt (/ 360 num))(draw-flowers size (* 5 num )))) (begin (repeat (quotient num 2) (lambda () (lt (/ 360 num))(draw-flowers size (* 4 num )) (lt (/ 360 num))(draw-flowers size (* 2 num)) )) (if (> (modulo num 2) 0)(begin (lt (/ 360 num))(draw-flowers size (* 4 num )))))) (lt 90)) (define (fib-visual n size width) (color "#291500") (if (< n 3) (begin (pensize width) (pendown) (fd size) (color "#2E1700") (pensize (* width 0.75))(bk size) (color "#331a00") (pensize (* width 0.6))(fd size) (draw-flowers 1 1) (penup) (bk size)) (begin (pendown)(pensize width) (fd size) (pensize (* width 0.75))(bk size) (color "#331a00") (pensize (* width 0.6))(fd size) (lt (if (= (modulo n 2) 0) 45 35)) (fib-visual (- n 1) (* size 0.6) (* width 0.6)) (rt 80) (fib-visual (- n 2) (* size 0.6) (* width 0.6)) (lt (if (= (modulo n 2) 0) 35 45)) (multiple-flowers 1 (fib n)) (penup)(bk size)))) (define (fib_list_visual n m x y size width space) (if (= n m) (begin (penup) (seth 0) (setpos x y) (fib-visual n size width) (setpos (- x) y)(fib-visual n size width)) (begin (penup)(fib_list_visual (- n 1) m (- x space 20) (+ y space) (* size 0.75)(* width 0.75)(* space 0.75)) (setpos x y) (fib-visual n size width) (setpos (- x) y) (fib-visual n size width)))) (bgcolor "#99ff33") (road) (sky) (fib_list_visual 8 5 525 (- 280) 250 50 150) (exitonclick)) ; 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)