;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Water Surface Slash That Final ;;; ;;; Description: ;;; Tanjiro-sama ;;; wishes you the best of luck ;;; on CS final (define (checkered) (define (horizontal pos_x end_x pos_y step) (if (not (= pos_x end_x)) (begin (if (= (modulo (/ (- end_x pos_x) step) 2) 0) (color "#0bda51") (color "#000000") ) (place pos_x pos_y 0) (begin_fill) (setpos pos_x (+ pos_y (abs step))) (setpos (+ pos_x step) (+ pos_y (abs step))) (setpos (+ pos_x step) pos_y) (end_fill) (horizontal (+ pos_x step) end_x pos_y step) ) ) ) (define (vertical pos_y end_y step) (if (not (= pos_y end_y)) (begin (if (= (modulo (/ (- end_y pos_y) step) 2) 0) (horizontal -500 500 pos_y step) (horizontal 500 -500 pos_y (* -1 step)) ) (vertical (+ pos_y step) end_y step) ) ) ) (pendown) (vertical -400 400 100) ) (define (single_wave offset thickness) (begin_fill) (forward (+ 80 offset)) (circle -500 32) (circle 200 60) (circle -300 45) (right 73) (forward (* 28 thickness)) (right 107) (circle 300 45) (circle -200 60) (circle 500 32) (forward (+ 80 offset)) (right 90) (forward (* 28 thickness)) (right 90) (end_fill) ) (define (get lst index) (cond ((null? lst) nil) ((= index 0) (car lst)) (else (get (cdr lst) (- index 1))) ) ) (define (slash n_waves) (define offsets '(0 20 50 10 0 30)) (define (helper n c o) (if (> n 0) (begin (define curr_offset (get offsets (modulo o 6))) (define thickness 1) (cond ((= (modulo c 5) 0) (color "#ffffff")) ((= (modulo c 5) 1) (begin (color "#366dd4") (define thickness 2))) ((= (modulo c 5) 2) (color "#66e1ff")) ((= (modulo c 5) 3) (color "#0c3c96")) ((= (modulo c 5) 4) (begin (color "#366dd4") (define thickness 2))) ) (penup) (left 90) (forward (* 15 thickness)) (right 90) (forward 17) (pendown) (single_wave curr_offset thickness) (helper (- n 1) (+ c 1) (+ o 1)) ) ) ) (helper n_waves 0 0) ) (define (place x y head) (penup) (setpos x y) (setheading head) (pendown) ) (define (single_swirl start_x start_y start_head n radius) (define (swirl n radius) (if (> n 0) (begin (circle (* -1 radius) 90) (swirl (- n 1) (* radius 0.618)) ) ) ) (color "#ffffff") (place start_x start_y start_head) (begin_fill) (forward (* 2.5 radius)) (right 90) (forward (* 0.3 radius)) (right 90) (forward (* 2.5 radius)) (end_fill) (place start_x start_y start_head) (begin_fill) (circle radius 60) (circle (* -1 radius) 90) (circle (* -0.618 radius) 90) (circle (* -0.382 radius) 90) (end_fill) (color "#000000") (place start_x start_y start_head) (circle radius 60) (swirl n radius) (place start_x (+ start_y 1) start_head) (circle radius 60) (swirl n radius) (place (+ start_x 1) start_y start_head) (circle radius 60) (swirl n radius) (place (+ start_x 1) (+ start_y 1) start_head) (circle radius 60) (swirl n radius) ) (define (swirls x y head n radius) ; radius = 500 (if (> n 0) (begin (single_swirl x y (+ head 180) 8 (* radius 0.1745 0.5)) (swirls (+ x (* radius 0.1745 (sin (radians (- head 10))))) (+ y (* radius 0.1745 (cos (radians (- head 10))))) (- head 10) (- n 1) radius) ) ) ) (define (tanjiro_head) (color "#af4459") (place -240 -195 0) (begin_fill) (setpos -300 -135) (setpos -260 -95) (setpos -200 -155) (end_fill) (penup) (setpos -100 0) (pendown) (color "#ebd4c7") (begin_fill) (setheading 0) ; forehead ; (right 90) (forward 50) (left 80) (forward 100) (left 90) (forward 280) (left 85) (forward 150) ; nose ; (circle 50 60) (right 73) (forward 60) (left 33) (forward 15) (left 68) (forward 33) (right 25) (forward 28) ; mouth ; (left 260) (circle 40 -180) (left 280) (forward 15) ;chin; (left 60) (forward 10) (right 60) (forward 30) (left 40) (forward 40) (left 57) (circle 750 20) (end_fill) (penup) ) (define (tanjiro_hair) (color "#360121") (setpos -60 15) (pendown) (begin_fill) ;overlapping hair; (forward 20) (circle 100 20) (right 30) (forward 10) ;back hair; (right 150) (circle 80 90) (right 40) (circle 150 -50) (backward 80) (left 100) ;top hair; (circle 100 60) (right 30) (circle 150 -20) (backward 70) (left 30) (forward 10) (right 10) (circle 300 20) (right 30) (circle 400 -10) (right 210) (circle 600 16) ;front hair; (right 150) (circle 60 60) (right 40) (circle 160 -40) (right 150) (circle 250 30) (right 180) (circle 200 -30) (right 40) (circle 100 50) (left 180) (circle 100 -100) ;back to overlapping hair; (backward 20) (right 20) (circle 100 -60) (right 15) (circle 200 30) (left 60) (circle 100 -30) (end_fill) (penup) ) (define (tanjiro_back) (color "#360121") (setpos 0 150) (pendown) (begin_fill) ;very back of hair; (right 80) (circle 400 13) (left 25) (circle 600 -10) (right 60) (circle 300 20) (left 20) (circle 790 -13) (setpos -60 200) (right 210) (circle 260 -17) (left 20) (circle 230 17) (right 30) (circle 400 -9) (end_fill) (penup) ) (define (tanjiro_scar) (color "#5a032b") (setpos -260 70) (pendown) (begin_fill) ;back half of scar; (forward 20) (right 30) (forward 50) (left 10) (backward 15) (right 23) (forward 50) (left 40) (backward 22) (right 30) (backward 60) ;front half of scar; (backward 30) (right 20) (backward 60) (left 10) (forward 18) (right 30) (backward 25) (right 40) (backward 30) (right 100) (backward 50) (left 20) (forward 10) (right 20) (backward 60) (left 20) (forward 30) (right 30) (backward 10) (left 30) (forward 30) (right 20) (backward 50) (left 30) (forward 15) (left 30) (forward 20) (left 153) (end_fill) (penup) ) (define (tanjiro_eyebrows) (color "#000000") (setpos -330 0) (pendown) (begin_fill) (left 95) (circle 200 -10) (left 25) (circle 100 3) (right 35) (circle 400 -8) (left 25) (circle 100 10) (right 35) (circle 300 10) (end_fill) (penup) ) (define (sword) (color "#aaaaaa") (place -290 -350 40) (begin_fill) (forward 600) (left 135) (forward 120) (circle 70 54) (forward 480) (end_fill) (color "#222222") (place -290 -350 40) (begin_fill) (forward 550) (left 135) (forward 95) (circle 50 52) (forward 450) (end_fill) ) (define (draw) (speed 0) (hideturtle) (checkered) (tanjiro_head) (tanjiro_scar) (tanjiro_hair) (tanjiro_back) (tanjiro_eyebrows) (color "#0c3c96") (setpos -300 -400) (begin_fill) (setpos 400 -400) (setpos 400 -50) (setpos 0 0) (end_fill) (place -298 -302 90) (slash 17) (swirls 320 10 -60 4 550) (swirls 350 -20 -55 5 550) (sword) (exitonclick)) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)