;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Mosaic Dragon ;;; ;;; Description: ;;; ;;; < 11:59 ;;; PM. Submit red dragon. ;;; 61A cry. > ;;;COLORS;;; (define redscales (cons-stream "#e92c38" (cons-stream "#f11200" (cons-stream "#be1e11" (cons-stream "#b6433a" redscales))))) (define redscales2 (cons-stream "#913237" (cons-stream "#7d0900" (cons-stream "#590600" (cons-stream "#c20000" redscales2))))) (define eyecolor (cons-stream "#ffda33" eyecolor)) (define iriscolor (cons-stream "#010901" iriscolor)) (define facecolor (cons-stream "#6c191e" (cons-stream "#510308" (cons-stream "#ae0000" (cons-stream "#e00000" facecolor))))) (define wingcolor (cons-stream "#ffa6a6" (cons-stream "#eaaeae" (cons-stream "#ff7979" (cons-stream "#d87575" wingcolor))))) (define skycolor (cons-stream "#000e87" (cons-stream "#4e18a1" (cons-stream "#182f48" (cons-stream "#000344" (cons-stream "#0852b4" (cons-stream "#3b0045" (cons-stream "#2e9486" (cons-stream "#000e87" (cons-stream "#4e18a1" (cons-stream "#182f48" (cons-stream "#000344" (cons-stream "#0852b4" (cons-stream "#3b0045" (cons-stream "#2e9486" (cons-stream "#000e87" (cons-stream "#4e18a1" (cons-stream "#182f48" (cons-stream "#000344" (cons-stream "#0852b4" (cons-stream "#3b0045" (cons-stream "#2e9486"(cons-stream "#000e87" (cons-stream "#4e18a1" (cons-stream "#182f48" (cons-stream "#000344" (cons-stream "#0852b4" (cons-stream "#3b0045" (cons-stream "#2e9486" (cons-stream "white" skycolor) ))))))))))))))))))))))))))))) (define hill0 (cons-stream "#6f3d6f" (cons-stream "#975297" (cons-stream "#14682d" (cons-stream "#37774f" hill0))))) (define hill1 (cons-stream "#826c00" (cons-stream "#c28b1d" (cons-stream "#de8700" (cons-stream "#857739" hill1))))) (define hill2 (cons-stream "#029b00" (cons-stream "#28933a" (cons-stream "#099700" (cons-stream "#5bb600" hill2))))) (define hill3 (cons-stream "#2f8478" (cons-stream "#06722f" (cons-stream "#00b875" (cons-stream "#006858" hill3))))) ;;;PLOT-CIRCLES;;; (define (scales r p c) (if (> (length p) 0) (begin (define x (car (car p))) (define y (car (cdr (car p)))) (penup) (goto x y) (begin_fill) (color "white") (circle r) (end_fill) (penup) (goto (- x (/ r 6)) y) (pendown) (begin_fill) (color (car c)) (circle (* r (/ 2.5 3))) (end_fill) (scales r (cdr p) (cdr-stream c))) 'done)) (define (pointlist n x y type) (define (lpoint i p) (define t i) (if (< i n) (cond ((equal? type "body") (lpoint (+ i 0.15) (append p (list (list (+ x (* 70 t)) (+ y (* 70 (sin (* 0.8 t))))))))) ((equal? type "sky") (lpoint (+ i 6) (append p (list (list (+ x t) y))))) ((equal? type "hill") (if (>= (+ y (abs (* 250 (sin (/ t 80))))) -250) (lpoint (+ i 5.5) (append p (list (list (+ x t) (+ y (abs (* 250 (sin (/ t 80))))))))) (lpoint (+ i 5.5) p)))) p)) (cond ((equal? type "body") (lpoint 1.4 (list))) ((equal? type "sky") (lpoint 0 (list))) ((equal? type "hill") (lpoint 0 (list))))) (define pi 3.14) ;;;DRAGON-BODY;;; (define (body) (define (lbody color x y z) (if (> z 0) (begin (scales 7 (pointlist 9.15 x y "body") color) (lbody (cdr-stream color) x (- y 9) (- z 1))) 'done)) (lbody redscales -135 -87 5)) ;;;DRAGON-FACE;;; (define face_coords '( ;right ear (0 0) (-9 0) (-18 0) (-27 0) (-36 0) (-9 -2) (-18 -4) (-27 -6) (-36 -9) ;left ear (0 -21) (-9 -21) (-21 -21) (-27 -21) (-36 -21) (-9 -23) (-21 -25) (-27 -27) (-36 -30) ;face (-47 -1) (-56 -1) (-65 -2) (-74 -3) (-83 -4) (-44 -9) (-56 -10) (-65 -11) (-74 -12) (-83 -13) (-92 -13) (-44 -17) (-56 -18) (-65 -19) (-74 -20) (-83 -21) (-92 -21) (-101 -21) (-110 -21) (-47 -25) (-56 -26) (-65 -28) (-74 -29) (-83 -29) (-92 -29) (-101 -29) (-110 -29) (-47 -34) (-56 -35) (-65 -37) (-74 -38) (-83 -38) (-92 -38) (-101 -38) (-110 -38) (-117 -38) (-47 -43) (-56 -43) (-65 -43) (-74 -47) (-83 -47) (-92 -47) (-101 -47) (-110 -47) (-117 -47) (-126 -47) (-135 -47) (-144 -47) (-153 -47) (-162 -53) (-47 -52) (-56 -52) (-65 -52) (-74 -56) (-83 -56) (-92 -56) (-101 -56) (-110 -56) (-117 -56) (-126 -56) (-135 -56) (-144 -56) (-153 -56) (-162 -56) (-47 -61) (-56 -61) (-65 -61) (-74 -61) (-83 -65) (-92 -65) (-101 -65) (-110 -65) (-117 -65) (-126 -65) (-135 -65) (-144 -65) (-153 -65) (-162 -62) (-47 -65) (-56 -70) (-65 -70) (-74 -70) (-83 -74) (-92 -74) (-101 -74) (-110 -74) (-117 -74) (-126 -74) (-135 -74) (-144 -74) (-153 -69) (-54 -74) (-65 -79) (-74 -79) (-83 -76) (-110 -79) (-117 -83) (-126 -79)) ) (define (face) (scales 6.5 face_coords facecolor)) ;;;DRAGON-EYE;;; (define (eye) (scales 6.8 '((-83 -38)) eyecolor) (scales 4.2 '((-86 -38)) iriscolor) (scales 2 '((-85 -39)) (cons-stream "white" 1))) ;;;DRAGON-WINGS;;; (define wingcoords1 '((0 0) (9 0) (18 0) (27 0) (36 0) (45 0) (54 0) (-9 -9) (0 -9) (9 -9) (18 -9) (27 -9) (36 -9) (45 -9) (54 -9) (63 -9) (72 -9) (81 -9) (90 -9) (99 -9) (-18 -18) (-9 -18)(0 -18) (9 -18) (72 -18) (81 -18) (90 -18) (99 -18) (108 -18) (117 -18) (126 -18) (135 -18) (-18 -27) (-9 -27)(0 -27) (9 -27) (72 -27) (81 -27) (90 -27) (99 -27) (108 -27) (117 -27) (126 -27) (135 -27) (-27 -36)(-18 -36) (-9 -36) (0 -36) (9 -36) (18 -36) (81 -36) (90 -36) (99 -36) (108 -36) (117 -36) (126 -36) (135 -36)(144 -36) (153 -36) (162 -36) (171 -36) (-27 -48)(-18 -48) (-9 -48) (0 -48) (18 -48) (99 -48) (108 -48) (117 -48) (126 -48) (135 -48)(144 -48) (153 -48) (162 -48) (171 -48) (-36 -54)(-27 -54)(-18 -54) (-9 -54) (0 -54) (27 -54) (117 -54) (126 -54) (135 -54)(144 -54) (153 -54) (162 -54) (171 -54)(180 -54) (-36 -63)(-27 -63)(-18 -63) (-9 -63) (36 -63) (126 -63) (135 -63)(144 -63) (153 -63) (162 -63)(171 -63) (180 -63) (189 -63) (198 -63) (-36 -72)(-27 -72)(-18 -72) (45 -72) (126 -72) (135 -72)(144 -72) (153 -72) (162 -72)(171 -72) (180 -72) (189 -72) (198 -72) (-45 -81)(-36 -81)(-27 -81)(-18 -81) (54 -81) (135 -81)(144 -81) (153 -81) (162 -81)(171 -81) (180 -81) (189 -81) (198 -81) (207 -81) (-45 -90)(-36 -90)(-27 -90) (63 -90) (-45 -99)(-36 -99)(-27 -99) (72 -99) (-36 -108)(-27 -108)(-18 -108) (72 -108) (-27 -117)(-18 -117) (75 -117) )) (define wingcoords2 '((18 -18) (27 -18) (36 -18) (45 -18) (54 -18) (63 -18) (18 -27) (27 -27) (36 -27) (45 -27) (54 -27) (63 -27) (18 -36) (27 -36) (36 -36) (45 -36) (54 -36) (63 -36)(72 -36) (9 -48)(27 -48) (36 -48) (45 -48) (54 -48) (63 -48)(72 -48)(81 -48) (90 -48) (9 -54)(18 -54)(36 -54) (45 -54) (54 -54) (63 -54)(72 -54)(81 -54) (90 -54) (99 -54)(108 -54) (0 -63)(9 -63)(18 -63)(27 -63) (45 -63) (54 -63) (63 -63)(72 -63)(81 -63) (90 -63) (99 -63)(108 -63)(117 -63) (-9 -72)(0 -72)(9 -72)(18 -72)(27 -72) (36 -72) (54 -72) (63 -72)(72 -72)(81 -72) (90 -72) (99 -72)(108 -72)(117 -72) (-9 -81)(0 -81)(9 -81)(18 -81)(27 -81) (36 -81) (45 -81) (63 -81)(72 -81)(81 -81) (90 -81) (99 -81)(108 -81)(117 -81)(126 -81) (-18 -90)(-9 -90)(0 -90)(9 -90)(18 -90)(27 -90) (36 -90) (45 -90) (54 -90)(72 -90)(81 -90) (90 -90) (99 -90)(108 -90)(117 -90) (-18 -99)(-9 -99)(0 -99)(9 -99)(18 -99)(27 -99) (36 -99) (45 -99) (54 -99)(63 -99)(81 -99) (90 -99) (99 -99)(108 -99) (-9 -108)(0 -108)(9 -108)(18 -108)(27 -108) (36 -108) (45 -108) (54 -108)(63 -108)(81 -108) (90 -108) (99 -108) (-9 -117)(0 -108)(9 -108)(18 -108)(27 -108) (36 -108) (45 -108) (54 -108)(63 -108)(81 -108) (90 -108) )) (define (movewings x y coords) (define (lmovwin l c) (if (> (length c) 0) (lmovwin (append l (list (list (+ x (car (car c))) (+ y (car (cdr (car c))))))) (cdr c)) l)) (lmovwin (list) coords)) (define (wings) (scales 6.5 (movewings 175 30 wingcoords2) wingcolor) (scales 6.5 (movewings 175 30 wingcoords1) redscales2)) ;;;BACKGROUND-SKY;;; (define (sky) (define (lsky color x y z) (if (> z 0) (begin (scales 2.75 (pointlist 1000 x y "sky") color) (lsky (cdr-stream (cdr-stream (cdr-stream (cdr-stream (cdr-stream (cdr-stream (cdr-stream (cdr-stream (cdr-stream (cdr-stream (cdr-stream color) )))))))))) x (+ y 8) (- z 1))) 'done)) (lsky skycolor -500 -250 50)) ;;;BACKGROUND-GROUND;;; (define (hills) (define (lhills color x y z) (if (> z 0) (begin (scales 6 (pointlist 1000 x y "hill") color) (cond ((= (modulo z 4) 0) (define color hill0)) ((= (modulo z 4) 1) (define color hill1)) ((= (modulo z 4) 2) (define color hill2)) ((= (modulo z 4) 3) (define color hill3))) (lhills color x (- y 12) (- z 1)) ) 'done)) (lhills hill3 -500 -250 22)) ;;;;;;;;;;;;;;ALL PUT TOGETHER YAY!;;;;;;;;;;;;;;;;;; (define (draw) (speed 0) (bgcolor "black") (sky) (hills) (body) (face) (wings) (eye) (penup) (goto -500 150) (color "black") (pendown) (begin_fill) (right 90) (forward 1000) (right 90) (forward 400) (right 90) (forward 1000) (right 90) (forward 500) (right 90) (forward 1100) (right 90) (forward 600) (right 90) (forward 1200) (right 90) (forward 600) (right 90) (forward 100) (end_fill) (ht) (exitonclick)) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)