;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Tik Tok ;;; ;;; Description: ;;; Tik tok as I sob. ;;; Work my ass off to unlock, ;;; Just to get a job. (define (draw) (speed 0) (draw-tik-tok) (reset_pos 0 0 0) (draw_oski 130 130 -130 0) (hideturtle) (exitonclick)) (define (reset_pos x y angle) (penup) (goto x y) (seth angle) (pendown)) (define (draw_oski size x y angle) (reset_pos x y angle) (oski_arm (* 1.2 size) (list "#dc9b00" "#dfa206" "#E3AA0D" "#E6B114" "#EAB91A" "#EDC021" "#F1C828" "#F8D735" "#F8D735" "#FBDE3C" "#ffe643") #t) (reset_pos (+ x size) (+ y (* size -.4)) (+ angle 0)) (oski_body size (list "#dc9b00" "#dfa206" "#E3AA0D" "#E6B114" "#EAB91A" "#EDC021" "#F1C828" "#F8D735" "#F8D735" "#FBDE3C" "#ffe643")) (reset_pos (+ x size) (+ y size) (+ angle 30)) (oski_head (* .5 size) (list "#603a28" "#75513C" "#8B6851" "#A17F65" "#B7967A" "#cdad8f")) (reset_pos (+ x size) (+ y (* size -.2)) (+ angle -0)) (oski_arm (* 1.4 size) (list "#dc9b00" "#dfa206" "#E3AA0D" "#E6B114" "#EAB91A" "#EDC021" "#F1C828" "#F8D735" "#F8D735" "#FBDE3C" "#ffe643") #f)) (define (oski_body length color_layers) (recursive_oski_oval length (* .8 length) color_layers .12)) (define (oski_head length color_layers) (oski_ears length (list "#603a28")) (seth 30) (backward (* 1.2 length)) (right 90) (forward (* .8 length)) (left 90) (recursive_oski_oval length length color_layers .15) (penup) (backward (* .24 length)) (left 90) (forward (* .1 length)) (right 90) (pendown) (recursive_oski_eye length (list "#000000" "#FFFFFF" "#CCCCCC" "#999999" "#666666" "#333333" "#000000") .05) (penup) (right 90) (backward (* .4 length)) (left 90) (pendown) (recursive_oski_eye length (list "#000000" "#FFFFFF" "#CCCCCC" "#999999" "#666666" "#333333" "#000000") .05) (penup) (backward (* .2 length)) (right 90) (forward (* .2 length)) (left 90) (pendown) (recursive_oski_oval (* .25 length) (* .25 length) (list "#412E25" "#45342D" "#4A3A36" "#4E413E" "#534747" "#584E4F" "#5C5458" "#615A60" "#656169" "#6A6771") .2) (penup) (right 90) (forward (* .9 length)) (right 90) (forward (* .1 length)) (recursive_oski_mouth length (list "#000000" "#e35d6a" "#E57177" "#E78584" "#E99992" "#EBAD9F" "#eec1ad") 1.2) (penup) (right 30) (backward (* .5 length)) (right 110) (pendown) (oski_tear (* .3 length) (list "#0078A4" "#1C94A3" "#44B5B2" "#77D5C0" "#B6F9CF") .05)) (define (oski_ears length color_layers) (recursive_oski_circle length color_layers 0) (penup) (left 90) (forward (* .5 length)) (right 45) (forward (* .5 length)) (pendown) (recursive_oski_circle length color_layers 0)) (define (recursive_oski_circle size color_layers layer_separation) (if (not (null? color_layers)) (begin (color (car color_layers)) (begin_fill) (circle (* .4 size) 360) (end_fill) (left 90) (forward (* layer_separation size)) (right 90)))) (define (recursive_oski_oval length width color_layers layer_separation) (if (not (null? color_layers)) (begin (color (car color_layers)) (begin_fill) (circle width 180) (forward (* .8 length)) (circle width 180) (forward (* .8 length)) (end_fill) (left 90) (forward (* layer_separation length)) (right 90) (recursive_oski_oval (* .9 length) (* .9 width) (cdr color_layers) layer_separation)))) (define (recursive_oski_eye length color_layers layer_separation) (if (not (null? color_layers)) (begin (color (car color_layers)) (begin_fill) (forward (* .2 length)) (circle (* .25 length) 180) (forward (* .2 length)) (left 90) (forward (* .5 length)) (end_fill) (backward (* layer_separation length)) (left 90) (recursive_oski_eye (* 0.9 length) (cdr color_layers) layer_separation)))) (define (recursive_oski_mouth length color_layers layer_separation) (if (not (null? color_layers)) (begin (color (car color_layers)) (begin_fill) (circle (* 2 length) 15) (right 90) (forward (* (* layer_separation 0.75) length)) (right 145) (forward (* layer_separation length)) (end_fill) (right 140) (forward (* (* layer_separation .17) length)) (recursive_oski_mouth (* .7 length) (cdr color_layers) layer_separation) ))) (define (oski_tear length color_layers layer_separation) (recursive_oski_oval length (* .2 length) color_layers layer_separation)) (define (oski_arm length color_layers hand) (right 40) (recursive_oski_oval length (* 0.2 length) color_layers .03) (penup) (seth 0) (backward (* .75 length)) (left 90) (forward (* .75 length)) (left 160) (pendown) (recursive_oski_oval (* .8 length) (* 0.2 length) color_layers .03) (if hand (begin (penup) (backward (* .9 length)) (right 30) (pendown) (recursive_oski_oval (* .1 length) (* .15 length) (list "#c8c0c2" "#D3CCCE" "#DED9DA" "#E9E5E6" "#F4F2F2" "#FFFFFF") .15) (penup) (backward (* .2 length)) (right 90) (forward (* .03 length)) (left 90) (pendown) (recursive_oski_fingers (* .2 length) (list "#c8c0c2" "#D3CCCE" "#DED9DA" "#E9E5E6" "#F4F2F2" "#FFFFFF") 0.012)) (begin (penup) (backward (* 1 length)) (right 32) (backward (* .2 length)) (pendown) (recursive_oski_fingers (* .2 length) (list "#c8c0c2" "#D3CCCE" "#DED9DA" "#E9E5E6" "#F4F2F2" "#FFFFFF") 0.012) (penup) (backward (* .05 length)) (left 90) (forward (* .05 length)) (pendown) (recursive_oski_oval (* .1 length) (* .15 length) (list "#c8c0c2" "#D3CCCE" "#DED9DA" "#E9E5E6" "#F4F2F2" "#FFFFFF") .15)))) (define (recursive_oski_fingers length color_layers layer_separation) (left 10) (recursive_oski_oval (* .7 length) (* .15 length) color_layers layer_separation) (penup) (left 90) (forward (* .25 length)) (right 100) (pendown) (recursive_oski_oval length (* .2 length) color_layers layer_separation) (penup) (left 90) (forward (* .3 length)) (right 90) (pendown) (recursive_oski_oval length (* .22 length) color_layers layer_separation) (penup) (left 90) (forward (* .25 length)) (right 110) (pendown) (recursive_oski_oval length (* .2 length) color_layers layer_separation) (penup) (forward length) (left 120) (forward (* 1.1 length)) (pendown) (recursive_oski_oval (* .8 length) (* .15 length) color_layers layer_separation)) (define green_colors (list "#4FA220" "#60BD22" "#72D925" "#84F528" "#8AFF29")) (define red_colors (list "#D91208" "#E22722" "#EB3C3D" "#EB3C3D" "#F14A4F")) (define yellow_colors (list "#E5C30B" "#EBD32E" "#F2E452" "#F9F476" "#FCFA82")) (define star_colors (list "#00416a" "#2b5379" "#476788" "#617b97" "#7a8fa6" "#94a4b6" "#aeb9c5" "#c9cfd6" "#e4e5e6")) (define clockcolor (list "#19547B" "#32627E" "#4C7182" "#658085" "#7F8E89" "#989D8C" "#B2AC90" "#CBBA93" "#E5C997" "#FFD89B")) (define (draw-tik-tok) (recursive-circles clockcolor 10 660 120 120 660 0.77 0.77) (draw_stars) (terminal (+ (/ (screen_width) -2) 18) -30 (- (/ (screen_height) 2) 100) (- (/ (screen_width) 2) 20) "#1e1e1e" "61 test cases passed! No cases failed." 100) (terminal (+ (/ (screen_width) -2) 18) (- (/ (screen_height) 2) 130) 10 (- (/ (screen_width) 2) 20) "#3d3e40" nil -7) (recursive-buttons (+ (/ (screen_width) -2) 24) (- (/ (screen_height) 2) 125) 30 10 (list red_colors yellow_colors green_colors )) (clockhand 120 120 (* (/ -3 4) 30) 30) ;hour (clockhand 120 120 290 40) ;minute (clockgraduation 120 120 '(0 90 180 270) 50 6)) (define (show-message message size) (pencolor "white") (if (not (null? message)) (write message size))) (define (recursive-buttons start-x start-y x-interval radius colors) (cond ((null? colors) nil) (else (recursive-circles (car colors) 5 start-x start-y 0 radius 1 0.9) (recursive-buttons (+ start-x x-interval) start-y x-interval radius (cdr colors))))) (define (terminal x y height width c message distance) (goto x y) (pd) (color c) (begin_fill) (rect height width) (pu) (goto x (+ y distance)) (pu) (end_fill) (show-message message 15)) (define (recursive-circles cs start x y x_translation radius x_factor radius_factor) (cond ((> start 0) (penup) (goto (+ x x_translation) y) (begin_fill) (pendown) (color (car cs)) (circle radius 360) (end_fill) (penup) (end_fill) (recursive-circles (cdr cs) (- start 1) (* x x_factor) y x_translation (* radius radius_factor) x_factor radius_factor)) (else (penup)))) (define (clockhand x y angle length) (goto x y) (seth angle) (pd) (pencolor "black") (pensize 5) (forward length) (pensize 1)) (define (clockgraduation center-x center-y angle-list center-dist length) (pencolor "black") (pensize 5) (pu) (map (lambda (angle) (begin (goto center-x center-y) (seth angle) (fd center-dist) (pd) (fd length) (pu))) angle-list) (pensize 1)) (define (rect height width) (seth 180) (map (lambda (arg) (begin (backward arg) (circle 10 -90))) (list height width height width))) (define (draw_stars) (recursive_star 300 170 12 star_colors 0.8) (recursive_star -275 300 22 star_colors 0.8) (recursive_star -100 300 15 star_colors 0.8) (recursive_star -60 270 13 star_colors 0.8) (recursive_star 220 200 4 star_colors 0.8) (recursive_star -220 -90 18 star_colors 0.8) (recursive_star -270 -285 30 star_colors 0.8) (recursive_star 270 -100 10 star_colors 0.8) (recursive_star 290 -255 18 star_colors 0.8)) (define (draw-side len n) (forward len) (right 72) (forward len) (left 144) (if (= n 1) nil (draw-side len (- n 1)))) (define (recursive_star x y radius colors factor) (cond ((null? colors) nil) (else (pu) (goto x y) (seth 0) (right 162) (forward radius) (seth 0) (pd) (color (car colors)) (begin_fill) (define side (* (/ radius (sin (radians 126))) (sin (radians 36)))) (draw-side side 5) (end_fill) (pu) (recursive_star x y (* radius factor) (cdr colors) factor)))) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)