;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Lonely Loop ;;; ;;; Description: ;;; Beautiful balloon ;;; Floats freely in memeless dreams ;;; Needs a companion (define (draw) (speed 0) (back 360 330) (goto 0 0) (exitonclick)) (define blue (list "#20468B" "#78F5FF")) (define orange (list "#FCF93C" "#E18928")) (define balloon (list "#79527D" "#A27A9D")) (addshape 'pic.gif) (define (back x y) (if (<= y -330) (penup) (begin (stream x y) (back x (- y 10))))) (define (stream x y) (if (<= x -360) (penup) (begin (if (or (inballoon x y) (inballoonstr x y) (> 3 (inportal x y))) (begin (colors x y) (dr x y) (end_fill) (if (and (or (inballoon x y) (inballoonstr x y)) (< y -150)) (dr x (+ y 350)) ()))) (stream (- x 10) y)))) (define (dr x y) (begin (penup) (goto x y) (begin_fill) (circle (rand 8 12)) (end_fill))) (define (colors x y) (cond ((inballoon x y) (chooser balloon)) ((inballoonstr x y) (color "#FDFDFD")) ((= (inportal x y) 1) (chooser orange)) (else (chooser blue)))) (define (inportal x y) (cond ((<= (ellipse x y 0 200 160 80) 1) 1) ((<= (ellipse x y 0 -200 160 80) 1) 2) (else 3))) (define (chooser clst) (if (= 2 (rand 1 3)) (color (car clst)) (color (car (cdr clst))))) (define (inballoon x y) (if (<= (ellipse x y 0 -100 80 90) 1) True False)) (define (inballoonstr x y) (if (and (<= (abs (- x (- (* 30 (sin (* .08 y))) 0))) 7) (and (> y -265) (< y -190))) True False)) (define (ellipse x y hs vs xs ys) (+ (expt (/ (- x hs) xs) 2) (expt (/ (- y vs) ys) 2))) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)