;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Scheme Master Rohin ;;; ;;; Haiku: ;;; Scheme master Rohin ;;; Hours of work and no play ;;; Please show us your ways ;;; ;;; Description: ;;; This turtle graphic was created first with a sketch, then translated into ;;; turtle syntax for each line by hand. ;;; ;;; Breaks in spacing indicate a new line being drawn, whether it's part of the ;;; eye or the neck-line area. ;;; ;;; I originally wanted to make graphics for both Andrew and Rohin. However, this ;;; turned out to be more time consuming than I thought (and, you know, finals), ;;; so I just completed the sketch I had that I thought looked better, namely, ;;; Rohin. If interested, I can finish Andrew's sometime in the future and submit ;;; them (and an improved version of Rohin) in 61A history together. ; (bgpic "inst.gif") ; The way I translated a sketch into turtle syntax ; Uncomment previous line once obtained said sketch ; Rohin's looks better yes? (define (draw) (bgcolor "#E8DAC6") (speed 0) (background) (right 86) ; reset cursor to default direction (pendown) (color "black") (rohin) ; (andrew) (hideturtle) (exitonclick) ) (define (rohin) (rohin-face-outline) (rohin-right-ear) (rohin-neck) (rohin-left-ear) (rohin-hair) (rohin-eyebrows) (rohin-glasses) (rohin-right-eye -248 58) (rohin-left-eye -427 41) (rohin-nose) (rohin-lips) (rohin-teeth) (rohin-edges) ) ; the part that would have been implemented given the time ; (define (andrew) ; (andrew-outline) ; (andrew-hair) ; (andrew-left-eye) ; (andrew-right-eye) ; (andrew-nose) ; (andrew-mouth) ; ) (define (rohin-face-outline) (penup) (setposition -240 290) (pensize 3) (pendown) (right 30) (circle -100 45) (circle -10 114.5) (forward 30) (circle 200 50) (right 5) (forward 30) (left 10) (forward 40) (circle 60 60) (right 5) (forward 25) (left 25) (forward 25) (right 25) (forward 50) (left 10) (forward 55) (right 20) (forward 30) (circle 100 55) (forward 40) (left 10) (forward 30) (right 10) (forward 10) (circle 50 60) (right 40) (circle 95 40) (left 22.75) (forward 80) (right 20) (forward 15) (left 20) (circle 70 35) (forward 50) (circle -40 15) (penup) ) (define (rohin-right-ear) (setposition -100 -45) (pendown) (pensize 3) (right 120) (circle 30 90) (left 20) (forward 30) (left 10) (forward 50) (circle 50 60) (penup) (setposition -67 3) (pendown) (pensize 0) (circle 20 -90) (penup) ) (define (rohin-neck) (pensize 3) (setposition -145 -175) (pendown) (left 45) (circle -400 -20) (penup) (setposition 0 -275) (pendown) (left 50) (forward 162) (penup) (setposition -390 -175) (pendown) (right 45) (circle 400 -20) (penup) (setposition -390 -180) (pendown) (right 45) (backward 100) (penup) ) (define (rohin-left-ear) (setposition -420 -80) (pendown) (right 45) (circle 100 -20) (right 45) (circle 300 -15) (penup) ) (define (rohin-hair) (setposition -438 -30) (pendown) (left 60) (circle 80 -80) (circle -50 -55) (circle 100 -85) (circle 500 -30) (right 20) (circle 250 -60) (circle -40 -35) (circle 100 -60) (circle 150 -60) (circle -70 -40) (circle 150 80) (circle -40 40) (circle -100 50) (penup) ) (define (rohin-eyebrows) (setposition -150 105) (pendown) (left 80) (circle 100 50) (left 45) (forward 45) (right 45) (circle -50 -20) (backward 30) (right 30) (backward 60) (penup) (setposition -315 72) (pendown) (right 45) (forward 40) (left 20) (circle 100 60) (left 50) (forward 20) (penup) ) ; an edited version of rohin-glasses that I like better ; but unfortunately can't replace the code I've already implemented ; (define (rohin-glasses) ; (setposition -450 60) ; (pendown) ; (left 5) ; (forward 35) ; (circle 30 90) ; (forward 80) ; (circle 30 45) ; (circle 100 20) ; (circle -20 70) (define (rohin-glasses) (setposition -450 60) (pendown) (left 5) (forward 35) (circle 30 90) (forward 80) (circle 30 45) (forward 50) ;;; where the glasses would have replaced above this line (right 45) (forward 30) (right 90) (circle 40 85) (circle 300 15) (circle 30 50) (circle -30 50) (left 90) (forward 30) (left 70) (forward 20) (right 30) (circle 40 30) (circle 300 20) (circle 30 30) (forward 20) (right 45) (forward 20) (circle -40 30) (left 20) (circle 300 22.5) (circle 20 90) (penup) ; left lens (setposition -445 54) (lens) ; right lens (setposition -250 68) (left 15) (lens) ) (define (lens) (pendown) (pensize 0) (left 5) (forward 30) (circle 30 80) (forward 65) (circle 30 170) (circle 300 20) (left 70) (penup) ) (define (rohin-right-eye x y) (setposition x y) (pendown) (pensize 3) (right 45) (circle 90 -70) (right 35) (backward 12) (penup) (setposition x (+ y 5)) (pendown) (left 35) (circle -90 -50) (circle 40 -40) (forward 10) (penup) (setposition (+ x 55) (+ y 22)) (pendown) (circle 15) (penup) (setposition x y) (pendown) (pensize 0) (left 70) (circle 80 -75) (right 30) (backward 12) (penup) (setposition (+ x 5) (- y 3)) (pendown) (left 25) (circle -100 -50) (forward 10) (penup) ) (define (rohin-left-eye x y) (pensize 3) (setposition x y) (pendown) (left 25) (circle 80 -70) (right 5) (backward 15) (penup) (setposition x y) (pendown) (left 35) (circle 40 -20) (circle -120 -45) (forward 10) (penup) (setposition (+ x 42) (+ y 21)) (pendown) (circle 16) (penup) (setposition x y) (pendown) (pensize 0) (left 15) (backward 10) (circle 80 -60) (right 20) (backward 15) (penup) (setposition x (- y 4)) (pendown) (right 170) (circle 120 50) (penup) ) (define (rohin-nose) (setposition -300 25) (pendown) (pensize 3) (right 127) (forward 55) (circle 20 90) (circle -30 30) (forward 10) (left 60) (forward 20) (left 40) (forward 20) (right 40) (forward 10) (circle 20 90) (circle 10 90) (penup) ) (define (rohin-lips) (setposition -175 -60) (pendown) (right 12) (circle 400 12) (right 20) (forward 90) (circle 10 150) (forward 30) (right 12) (forward 30) (left 30) (circle 200 25) (circle 30 50) (forward 50) (circle 30 30) (penup) (setposition -175 -65) (pendown) (left 98) (circle 400 12) (right 37) (circle 200 24) (circle 10 118) (left 26) (circle 220 26) (left 5) (circle 100 40) (penup) ) (define (rohin-teeth) (pensize 0) (setposition -185 -73) (pendown) (left 45) (circle 6 160) (forward 8) (circle -7 -170) (backward 20) (circle 8 45) (forward 7) (left 90) (forward 40) (right 25) (forward 20) (left 20) (forward 15) (right 25) (forward 10) (right 20) (circle 13 165) (forward 9) (circle 5 180) (backward 15) (circle -13 -85) (penup) (setposition -285 -105) (pendown) (left 60) (circle 15 170) (circle -10 -90) (backward 10) (circle -10 -120) (circle 8 90) (forward 6) (circle 8 90) (circle -8 -120) (penup) ) (define (rohin-edges) (setposition -310 -10) (pendown) (circle -200 13) (circle 60 75) (forward 40) (penup) (setposition -380 -130) (pendown) (circle 300 23) (penup) (setposition -225 -8) (pendown) (circle 300 12) (circle -30 80) (circle 200 18) (penup) (setposition -140 -50) (pendown) (left 20) (forward 10) (circle -50 40) (forward 130) (penup) (setposition -75 -60) (pendown) (pensize 3) (circle -10 90) (circle 10 90) (penup) ) (define (background) (penup) (setheading 85) (setposition -302 -927) (pendown) (pensize 30) (cool-star (reverse (interleave-lst color-lst1 color-lst2)) 2000 177.2) (cool-star (interleave-lst color-lst1 color-lst2) 2000 177.2) (penup) (setposition 10 1045) (pendown) (pensize 0) (cool-star (reverse (interleave-lst color-lst2 color-lst1)) 2000 179) (cool-star (interleave-lst color-lst1 color-lst2) 2000 179) (cool-star (reverse (interleave-lst color-lst2 color-lst1)) 2000 179) (cool-star (interleave-lst color-lst1 color-lst2) 2000 179) (cool-star (reverse (interleave-lst color-lst2 color-lst1)) 2000 179) (cool-star (interleave-lst color-lst1 color-lst2) 2000 179) (penup) ) ; implementation procedures (define (reverse lst) (if (null? lst) nil (append (reverse (cdr lst)) (list (car lst))) )) (define (interleave-lst lst1 lst2) (if (null? lst2) nil (cons (car lst1) (interleave-lst lst2 (cdr lst1)) ))) (define (cool-star lst x y) (define (helper) (color (car lst)) (forward x) (right y) (cool-star (cdr lst) x y) ) (if (not (eq? lst nil)) (helper) )) ; list of colors in the form of hexadecimals obtained from w3schools (define color-lst1 (cons "#262019" (cons "#393126" (cons "#4C4132" (cons "#5E513F" (cons "#71614C" (cons "#847158" (cons "#978265" (cons "#AA9271" (cons "#BDA27E" (cons "#C4AB8B" (cons "#CAB598" (cons "#D1BEA5" (cons "#D7C7B2" (cons "#DED0BE" (cons "#E5DACB" (list "#EBE3D8") )))))))))))))))) (define color-lst2 (cons "#221D17" (cons "#332C22" (cons "#443A2D" (cons "#554938" (cons "#665844" (cons "#77664F" (cons "#88755A" (cons "#998366" (cons "#AA9271" (cons "#B29D7F" (cons "#BBA88D" (cons "#C4B39C" (cons "#CCBEAA" (cons "#D4C8B8" (cons "#DDD3C6" (list "#E6DED4") )))))))))))))))) ; Please leave this last line alone. You may add additional procedures above ; this line. All Scheme tokens in this file (including the one below) count ; toward the token limit. (draw)