"""turtle contest""" ; (define (box initial) ; (cond ; ((= initial 0) ) ; (else (pendown) (fd initial) (lt 90) (box (- initial 1))) ; )) ; (define (circles initial) ; (speed 0) ; (pendown) ; (cond ; ((= initial 0) ) ; (else (circle initial) (circles (- initial 1))) ; )) ; (define (lines x y) ; (pendown) ; (cond ; ((= x 1) ) ; ((= y 1) ) ; (else (goto x y) (lines (- x 1) (* -1 y) (lines (* -1 x) (- y 1)))) ; )) ; (define (cadr s) ; (cdr (car s))) ; (define (caar s) ; (car (car s))) ; (define (rotatedart positions colors sizes angle) ; (cond ; ((null? positions) ) ; (else ; (size 0.01) ; (color (car colors)) ; (penup) ; (goto (caar positions) (cadr positions)) ; (pendown) ; (rotated (car sizes) (car angle)) ; (rotatedart (cdr positions) (cdr colors) (cdr sizes) (cdr angle)) ; ))) ; (define (rotated initial angle) ; (pendown) ; (speed 0) ; (cond ; ((< initial 1) ) ; (else (circle initial) (lt angle) (rotated (- initial 1) angle)) ; )) (define (cCurve x1 y1 x2 y2 depth) (cond ((= depth 0) (penup) (goto x1 y1) (pendown) (goto x2 y2)) (else (cCurve (/ (- (+ x1 x2 y1) y2) 2) (/ (- (+ x2 y1 y2) x1) 2) x2 y2 (- depth 1)) (cCurve x1 y1 (/ (- (+ x1 x2 y1) y2) 2) (/ (- (+ x2 y1 y2) x1) 2) (- depth 1)) ) )) (define (drawer x) (color "blue") (cCurve 50 -50 50 50 x) (goto 50 -50) (goto 50 50) (color "yellow") (cCurve -100 -100 -100 100 x) (cCurve 400 -80 260 60 x)) ; (define (cal) ; (cCurve -100 -100 -100 100 5) ; (drawer) ; (penup) ; (color "yellow") ; (goto -500 0) ; (rotated 100 36)) ; (define (emergency) ; (color "blue") ; (cCurve 50 -100 50 100 5) ; (penup) ; (color "yellow") ; (goto -500 0) ; (rotated 100 60) ; (penup) ; (goto 400 0) ; (rotated 100 60) ; (penup) ; (goto 0 -200) ; (rotated 50 10) ; ) ; (define (mask x y) ; (setheading 0) ; (penup) ; (goto x (+ 55 y)) ; (begin_fill) ; (goto (+ 40 x) (+ 55 y)) ; (goto (+ 40 x) (+ 90 y)) ; (goto x (+ 90 y)) ; (goto x (+ 90 y)) ; (end_fill) ; (goto (+ 10 x) (+ 10 y)) ; (begin_fill) ; (goto (+ 10 x) (+ 45 y)) ; (goto (+ 50 x) (+ 45 y)) ; (goto (+ 50 x) (+ 10 y)) ; (goto (+ 10 x) (+ 10 y)) ; (end_fill) """2""" ; (goto (+ 50 x) y) ; (begin_fill) ; (goto (+ 50 x) (+ 100 y)) ; (goto (+ 60 x) (+ 100 y)) ; (goto (+ 60 x) y) ; (goto (+ 50 x) y) """space""" ; (end_fill) ; (goto (+ 70 x) (+ 10 y)) ; (begin_fill) ; (goto (+ 70 x) (+ 90 y)) ; (goto (+ 100 x) (+ 90 y)) ; (goto (+ 100 x) (+ 10 y)) ; (goto (+ 70 x) (+ 10 y)) ; (end_fill) """0""" ; (goto (+ 110 x) y) ; (begin_fill) ; (goto (+ 110 x) (+ 100 y)) ; (goto (+ 120 x) (+ 100 y)) ; (goto (+ 120 x) y) ; (goto (+ 110 x) y) ; (end_fill) """space""" ; (goto (+ 130 x) y) ; (begin_fill) ; (goto (+ 130 x) (+ 100 y)) ; (goto (+ 140 x) (+ 100 y)) ; (goto (+ 140 x) y) ; (goto (+ 130 x) y) ; (end_fill) ; (goto (+ 140 x) (+ 10 y)) ; (begin_fill) ; (goto (+ 140 x) (+ 45 y)) ; (goto (+ 180 x) (+ 45 y)) ; (goto (+ 180 x) (+ 10 y)) ; (goto (+ 140 x) (+ 10 y)) ; (end_fill) ; (goto (+ 150 x) (+ 55 y)) ; (begin_fill) ; (goto (+ 150 x) (+ 90 y)) ; (goto (+ 190 x) (+ 90 y)) ; (goto (+ 190 x) (+ 55 y)) ; (goto (+ 150 x) (+ 55 y)) ; (end_fill) """5""" ; (goto (* -1 (width)) (* -1 (height))) ; (begin_fill) ; (goto (* -1 (width)) (height)) ; (goto x (height)) ; (goto x (* -1 (height))) ; (goto (* -1 (width)) (* -1 (height))) ; (end_fill) ; (goto (width) (height)) ; (begin_fill) ; (goto (width) (* -1 (height))) ; (goto (width) (* -1 (height))) ; (goto (* -1 (width)) (* -1 (height))) ; ) """right""" ; (goto (+ 230 x) y) ; (goto (+ 230 x) (* -1 (height))) ; (goto x (* -1 (height))) ; (goto x y) ; (end_fill) """bottom""" ; (define (rotated2 initial angle) ; (pendown) ; (speed 0) ; (cond ; ((= initial 0) ) ; (else ))) ; (define (penchange xrange yrange) ; (cond ; ((< (xcor) xrange.first) (pendown)) ; ((< (ycor) yrange.first) (pendown)) ; ((> (xcor) xrange.second) (pendown)) ; ((> (ycor) yrange.second) (pendown)) ; (else (penup)) ; )) ; (define (fractal initial) ; (cond ; ((< initial 2) ) ; (else (penup) (goto (+ (xcor) (* 2 initial)) 0) (pendown) (circle initial) (fractal (/ initial 2) )) ; )) ; (define (fractalrepeat angle size) ; (repeater fractal -700 0 angle 0 size)) ; (define (repeater fn initialx initialy angle n x) ; (cond ; ((= n (/ 180 angle) )) ; (else ; (size (/ 50 (+ n 1))) ; (pencolor (rand 0 1) (rand 0 1) (rand 0 1)) ; (penup) ; (goto initialx initialy) ; (fn x) ; (rt angle) ; (repeater fn initialx initialy angle (+ 1 n) x)) ; )) ; (define (changecolor x) ; (pencolor x (/ x 2) (/ x 2.76))) ; (define (curve length angle) ; (cond ; ((= angle 0) ) ; (else (pendown) (fd length) (rt angle) (curve length (- angle 1))) ; )) ; (define (curve2 length angle) ; (cond ; ((= angle 0) ) ; (else (pendown) (fd length) (rt angle) (curve (- length 1) angle )) ; )) ; (define (fibonnaci n) ; (cond ; ((= n 1) n) ; ((= n 0) n) ; (else (+ (fibonnaci (- n 1)) (fibonnaci (- n 2)))) ; )) ; (define (fibonnacilines length angle) ; (pendown) ; (speed 10) ; (fd (fibonnaci length)) ; (rt angle) ; (fibonnacilines (- length 1) angle) ; ) ; (define (61a x y) ; (penup) ; (goto x y) ; (pendown) ; (setheading 0) ; (fd 120) """left edge""" ; (rt 90) ; (fd 90) ; (rt 90) ; (fd 25) ; (rt 90) ; (fd 65) ; (lt 90) ; (fd 35) ; (lt 90) ; (fd 65) ; (rt 90) ; (fd 60) ; (rt 90) ; (fd 90) ; (penup) ; (goto (+ x 25) (+ 25 y)) ; (setheading 90) ; (pendown) ; (fd 40) """square""" ; (lt 90) ; (fd 20) ; (lt 90) ; (fd 40) ; (lt 90) ; (fd 20) ; (penup) ; (goto (+ x 110) y) ; (setheading 0) ; (pendown) ; (fd 120) """line""" ; (rt 90) ; (fd 25) ; (rt 90) ; (fd 120) ; (rt 90) ; (fd 25) ; (penup) ; (goto (+ x 155) y) ; (setheading 0) ; (pendown) ; (fd 120) ; (rt 90) ; (fd 90) ; (rt 90) ; (fd 120) ; (rt 90) ; (fd 25) ; (rt 90) ; (fd 60) ; (lt 90) ; (fd 40) ; (lt 90) ; (fd 60) ; (rt 90) ; (fd 25) ; (penup) ; (goto (+ (xcor) 25) (+ (ycor) 75)) ; (pendown) ; (setheading 0) ; (fd 30) """A""" ; (rt 90) ; (fd 40) ; (rt 90) ; (fd 30) ; (rt 90) ; (fd 40) ; )