;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: The Two-Headed Beast ;;; ;;; Description: ;;; The Two-Headed Beast, ;;; who guards the A at all costs, ;;; wreaks havoc recursively. from turtle import * (define (mars paint x y) (setpos x y) (pendown) (color paint) (begin_fill) (circle 67) (end_fill) (penup) ) (define (earth paint x y) (setpos x y) (pendown) (color paint) (begin_fill) (circle 127) (end_fill) (penup) ) (define (moon paint x y size) (setpos x y) (pendown) (color paint) (begin_fill) (circle size) (end_fill) (penup) ) (define (craters paint x y size) (setpos x y) (pendown) (color paint) (begin_fill) (circle size) (end_fill) (penup) ) (define (stars paint size x y count) (cond ((< count 40) (setpos x y) (pendown) (color paint) (begin_fill) (circle size) (end_fill) (penup) (stars paint size (random_num -350 350) (random_num -350 350) (+ count 1)) ) (else nil) ) ) (define (vertical paint a b size count) (cond ((< count 5) (pixelsize size) (pixel a b paint) (vertical paint a (- b 1) size (+ count 1))) (else nil))) (define (horizontal paint a b size count) (cond ((< count 2) (pixelsize size) (pixel a b paint) (horizontal paint (+ a 1) b size (+ count 1))) (else nil))) (define (sq paint a b size count) (pixelsize size) (pixel a b paint)) (define (lasers paint size x y count) (cond ((< count 60) (setpos x y) (pendown) (color paint) (begin_fill) (circle size) (end_fill) (penup) (lasers paint size (+ x 2) (- y 2) (+ count 1)) ) (else nil) ) ) (define (fireball paint size x y count) (cond ((< count 60) (setpos x y) (pendown) (color paint) (begin_fill) (circle size) (end_fill) (penup) (fireball paint size (+ x 3) (- y 15) (+ count 1)) ) (else nil) ) ) (define (draw) (speed 100000) (bgcolor "#000000") (hideturtle) ;stars (stars "#ffeb7f" 1 0 0 0) (stars "#ffd700" 0.5 0 0 -80) (stars "#DAA520" 0.5 0 0 -80) (stars "#ffffff" 0.5 0 0 0) (stars "#ffeb7f" 1.5 0 0 0) ; planets/moon (earth "#3036c6" 320 -180) (mars "#c1440e" -200 220) (moon "#9c9c9c" 360 -20 34) (craters "#808080" 355 -30 2) (craters "#808080" 320 -50 2) (craters "#808080" 318 -30 8) (craters "#808080" 350 -10 7) (craters "#808080" 310 -10 5) (craters "#808080" 340 -40 3) (craters "#808080" 325 10 3) ; letters (vertical "#008000" 24 9 20 0); 6 (horizontal "#008000" 25 9 20 0); 6 (horizontal "#008000" 25 7 20 0); 6 (horizontal "#008000" 25 5 20 0); 6 (sq "#008000" 26 6 20 0) ; 6 (vertical "#008000" 28 9 20 0) ; one (vertical "#008000" 31 9 20 0) ; A (vertical "#008000" 33 9 20 0) ; A (sq "#008000" 32 9 20 0) ; A (sq "#008000" 32 7 20 0) ; A (vertical "#FF4500" 6 38 15 0) ; mars A (vertical "#FF4500" 9 38 15 0) ; mars A (horizontal "#FF4500" 7 38 15 0) ; mars A (horizontal "#FF4500" 7 36 15 0) ; mars A ; aliens (goto 90 80) (insertpic 'stan.gif) (stamp) (fireball "#E27822" 7 85 30 51) (moon "#E27822" 125 -100 20) ; explosion (goto -100 -30) (insertpic 'kevin.gif) (stamp) (lasers "#FF4500" 2 -65 -25 -10) (lasers "#FF4500" 2 -40 -30 0) (moon "#FF4500" 90 -150 20) ; explosion (exitonclick)) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)