;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Roses on the River ;;; ;;; Description: ;;; Wilt in your comfort, ;;; or leap off the binding stem. ;;; Journey the unknown. (define scale 300) (define nscale (- 0 scale)) (define penupflag True) (define (sq x) (* x x)) (define (drawjpoint x y) (define mycolor (computejulia x y)) (define r (quotient mycolor 65536)) (define r1 (modulo mycolor 65536)) (define g (quotient r1 256)) (if (> g 200) (define g (quotient g 10)) ) (if (> g 100) (define g (- g 80)) ) (define b (modulo r1 256)) (setpos x y) (if penupflag (begin (pendown) (define penupflag False))) (rgb (modulo r 256) g b)) (define (loop2 f x y) (define yx (- y x) ) (define r (+ (sq x) (sq y) )) (if (or (and (< yx scale) (> yx nscale )) (< r (sq scale))) (f x y)) (if (> y nscale) (loop2 f x (- y 1)))) (define (drawj width height) (drawjrow width height) (if (> width nscale) (drawj (- width 1) height))) (define (drawjrow row col) (penup) (define penupflag True) (loop2 drawjpoint row col)) (define (helper x y level) (if (> (+ (sq x) (sq y)) 4) level (begin (define newx (+ (- (sq x) (sq y)) 0.1 )) (define newy (+ (* 2 (* x y)) -0.7)) (helper newx newy (+ level 1))))) (define (computejulia x y) (* 899191 (helper (/ x scale) (/ y scale) 0))) (define (draw) (clear) (drawj scale scale) (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)