;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Lanterns ;;; ;;; Description: ;;; In the twilight sky ;;; Leave CS behind and see ;;; Lanterns floating by. (define (pentagon side-length clr sides-left) (if (= sides-left 0) nil (begin (color clr) (fd side-length) (rt 72) (pentagon side-length clr (- sides-left 1))))) (define (more how-many side-length clr) (if (= how-many 0) nil (begin (pentagon side-length clr 5) (rt 36) (more (- how-many 1) side-length clr) ))) (define (migrate x y) (penup) (setpos x y) (pendown) ) (define (next-clr clr) (cond ((equal? clr "white") "red") ((equal? clr "red") "yellow") ((equal? clr "yellow") "white") )) (define (beauty clr size x y) (if (= y 200) nil (begin (migrate x y) (more 10 size clr) (beauty (next-clr clr) (* (sin size) 20) (* (cos x) 300) (+ y 10)) ))) (define (draw) (begin (speed 50) (bgcolor "#073d93") (beauty "white" 10 -200 -200) (hideturtle) )) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)