;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Recursive what? ;;; ;;; Description: ;;; What do you see in this pattern? ;;; Circles? Waves? ;;; Or, Wi-Fis? (define (wave radius cx cy) (define num 5) (define sx (- cx (* radius 0.8660254))) (define sy (+ cy (* radius 0.5))) (define (helper ccx ccy n) (if (= n 0) () (begin (pu) (setpos ccx ccy) (pd) (seth 211) (define sum (+ (abs cx) (abs cy) (abs (+ cx cy)) 0.1)) (define red (/ (abs (+ cx cy)) (* sum 0.8))) (define green (/ (abs cy) (* sum 0.8))) (define blue (/ (abs cx) (* sum 0.8))) (color (rgb red green blue)) (circle (* radius (/ n num)) -118) (helper (/ (+ (* sx (- n 1)) (* cx (- num (- n 1)))) num) (/ (+ (* sy (- n 1)) (* cy (- num (- n 1)))) num) (- n 1) ) ) ) ) (helper sx sy num) ) (define (column-wave radius row cx cy) (if (= row 0) () (begin (wave radius cx cy) (column-wave radius (- row 1) cx (- cy radius)) ) ) ) (define (seigaiha radius row column sx sy) (define (helper i ccolumn cx cy) (if (= ccolumn 0) () (begin (column-wave radius row cx cy) (if (= (remainder i 2) 0) (helper (+ i 1) (- ccolumn 1) (+ cx radius) (+ cy (* radius 0.5))) (helper (+ i 1) (- ccolumn 1) (+ cx radius) (- cy (* radius 0.5))) ) ) ) ) (helper 0 column sx sy) ) (define (draw) (speed 0) (seigaiha 50 15 25 -600 300) (hideturtle) (exitonclick) ) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)