Baby Scheme Bulls Eye
Face House
Balloons Proportion Tri.

 

 

 

 

 

 

 

 

 

 

;;-------------DRAWING CANVAS---------------
(start 640 480)
;;-------------CONSTANT DATA----------------
(define Head
  (and
   (draw-circle (make-posn 320 100) 44 'black)
   (draw-circle (make-posn 300 95) 8 'green)
   (draw-solid-disk (make-posn 300 95) 7 'blue)
   (draw-solid-disk (make-posn 300 95) 3 'black)
   (draw-solid-disk (make-posn 340 95) 8 'green)
   (draw-solid-disk (make-posn 340 95) 7 'blue)
   (draw-solid-disk (make-posn 340 95) 3 'black)
   (draw-solid-rect (make-posn 315 108) 8 8 'black)
   (draw-solid-line (make-posn 315 125) (make-posn 320 130) 'red)
   (draw-solid-line (make-posn 315 126) (make-posn 320 131) 'red)
   (draw-solid-line (make-posn 325 125) (make-posn 320 130) 'red)
   (draw-solid-line (make-posn 325 126) (make-posn 320 131) 'red)
   ))

(define Body
  (and
   (draw-solid-rect (make-posn 305 145) 30 90 'red)
   (draw-solid-disk (make-posn 320 175) 30 'red)
   (draw-solid-rect (make-posn 290 235) 20 10 'red)
   (draw-solid-rect (make-posn 325 235) 20 10 'red)
   ))

(define Hair
  (and
   (draw-circle (make-posn 320 50) 5 'black)
   (draw-circle (make-posn 315 53) 5 'black)
   (draw-circle (make-posn 325 53) 5 'black)
   (draw-solid-line (make-posn 310 56) (make-posn 300 80) 'black)
   ))

(define (ground length width)
  (draw-solid-rect (make-posn 50 245) length width 'green))
(ground 350 10)
(ground 300 20)
(ground 250 30)

(define (sun center-x center-y radius)
  (and
   (draw-solid-disk (make-posn center-x center-y) radius 'yellow)
   (draw-solid-disk (make-posn center-x center-y) (- radius 10) 'red)
   (draw-solid-disk (make-posn center-x center-y) (- radius 20) 'yellow)
   (draw-solid-disk (make-posn center-x center-y) (- radius 30) 'white)
   (draw-solid-disk (make-posn center-x center-y) (- radius 40) 'yellow)
   ))

(sun 500 50 50)
(sun 550 30 50)

Top of page

Bullseye
;;bullseye: posn n -> true
;;draws a bullseye given the position of the center and radius of the largest circle
(define (bullseye center radius)
  (and
   (draw-solid-disk center radius 'blue)
   (draw-solid-disk center (- radius (/ radius 5)) 'green)
   (draw-solid-disk center (- radius (* 2(/ radius 5))) 'blue)
   (draw-solid-disk center (- radius (* 3(/ radius 5))) 'green)
   (draw-solid-disk center (- radius (* 4(/ radius 5))) 'blue)))

(start 300 300)
(bullseye (make-posn 150 150) 300)
(bullseye (make-posn 50 50) 30)
(bullseye (make-posn 150 150) 75)
(bullseye (make-posn 250 250) 30)
(bullseye (make-posn 200 200) 50)
(bullseye (make-posn 50 250) 30)
(bullseye (make-posn 250 50) 30)
(bullseye (make-posn 100 100) 50)
(bullseye (make-posn 300 0) 150)
(bullseye (make-posn 0 300) 150)

Top of page

Face
;;-------------------->TEACH PACK COORDINATE PLANE<-------------|
;;--------------------> Canvas Size <---------------------
(define L 400)     ;; Length of Canvas
(define M (/ L 2)) ;; Middle
(start L L)        ;; Starts a drawing canvas
;;------------------- > X-AXIS and Y-AXIS <------------------
;;(draw-solid-line (make-posn M 0) (make-posn M L))
;;(draw-solid-line (make-posn 0 M) (make-posn L M))
;;(define (line start end color)
;;  (draw-solid-line (make-posn (+ (posn-x start)M) (- M (posn-y start)))
;;                   (make-posn (+ (posn-x end) M) (- M (posn-y end))) color))
;;--------------------> Grid Line Markers <-----------------
;;(line (make-posn -5 100) (make-posn +5 100) 'black)
;;(line (make-posn 100 -5) (make-posn 100 +5) 'blue)
;;(line (make-posn -5 -100) (make-posn +5 -100)'green)
;;(line (make-posn -100 -5) (make-posn -100 +5) 'red)
;;---------------------> Shapes <---------------------------
(define (circle center radius color)
  (draw-circle (make-posn (+ M(posn-x center)) (- M (posn-y center))) radius color))
(define (disk center radius color)
  (draw-solid-disk (make-posn (+ M(posn-x center)) (- M (posn-y center))) radius color))
(define (rect corner L H color)
  (draw-solid-rect (make-posn (+ M (posn-x corner)) (- M (posn-y corner))) L H color))
;;-------------------->END OF TEACH PACK COORDINATE PLANE<-------------------|

;;--------------------> Sample Object <------------------
;;background color
;;(rect (make-posn -200 200) 400 400 'blue)
;;original
(circle (make-posn 0 0) 80 'green)
(disk (make-posn 30 30) 15 'blue)
(disk (make-posn -30 30) 15 'blue)
(rect (make-posn -40 -30) 80 5 'red)

;;START CHANGES

;;nose
(disk (make-posn 0 0) 10 'red)
;;hat
(rect (make-posn 0 80) 50 15 'black)
(rect (make-posn -50 80) 50 15 'black)
(rect (make-posn -25 120) 50 50 'black)
;;neck
(rect (make-posn -20 -80) 40 50 'green)
;;shirt
(rect (make-posn -60 -120) 120 160 'red)
(rect (make-posn -100 -120) 40 50 'red)
(rect (make-posn 60 -120) 40 50 'red)
;;arms
(rect (make-posn 100 -130) 40 100 'green)
(rect (make-posn -140 -130) 40 100 'green)
;;pupil right eye
(disk (make-posn 30 30) 7 'black)
;;pupil left eye
(disk (make-posn -30 30) 7 'black)
;;red eye
;;(disk (make-posn 30 30) 3 'red)
;;ear
(disk (make-posn -80 0) 20 'green)
(disk (make-posn 80 0) 20 'green)

Top of page

House
(start 640 480)
  ;;grass
(draw-solid-rect (make-posn 0 240) 640 240 'green)
  ;;sky
(draw-solid-rect (make-posn 0 0) 640 240 'blue)
  ;;sidewalk
(draw-solid-rect (make-posn 0 300) 640 120 'black)
(draw-solid-rect (make-posn 260 270) 120 30 'black)
  ;;main house rectangle
(draw-solid-rect (make-posn 60 110) 520 160 'yellow)
  ;;main house roof
(draw-solid-line (make-posn 60 110) (make-posn 320 0) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 580 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 560 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 540 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 520 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 500 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 480 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 460 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 440 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 420 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 400 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 380 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 360 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 340 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 320 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 300 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 280 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 260 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 240 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 220 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 200 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 180 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 160 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 140 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 120 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 100 110) 'yellow)
(draw-solid-line (make-posn 320 0) (make-posn 80 110) 'yellow)
  ;;door and doornob
(draw-solid-rect (make-posn 280 130) 80 140 'red)
(draw-solid-disk (make-posn 350 200) 8 'white)
  ;;left window
(draw-solid-rect (make-posn 140 140) 100 60 'red)
(draw-solid-rect (make-posn 160 140) 60 60 'white)
(draw-solid-line (make-posn 190 200) (make-posn 190 140) 'black)
(draw-solid-line (make-posn 160 170) (make-posn 220 170) 'black)
  ;;right window
(draw-solid-rect (make-posn 400 140) 100 60 'red)
(draw-solid-rect (make-posn 420 140) 60 60 'white)
(draw-solid-line (make-posn 450 200) (make-posn 450 140) 'black)
(draw-solid-line (make-posn 420 170) (make-posn 480 170) 'black)
  ;;bushes right
(draw-circle (make-posn 410 270) 30 'green)
(draw-circle (make-posn 420 270) 30 'green)
(draw-circle (make-posn 430 270) 30 'green)
(draw-circle (make-posn 440 270) 30 'green)
(draw-circle (make-posn 450 270) 30 'green)
(draw-circle (make-posn 460 270) 30 'green)
(draw-circle (make-posn 470 270) 30 'green)
(draw-circle (make-posn 480 270) 30 'green)
(draw-circle (make-posn 490 270) 30 'green)
(draw-circle (make-posn 500 270) 30 'green)
(draw-circle (make-posn 510 270) 30 'green)
(draw-circle (make-posn 520 270) 30 'green)
(draw-circle (make-posn 530 270) 30 'green)
(draw-circle (make-posn 540 270) 30 'green)
(draw-circle (make-posn 550 270) 30 'green)
(draw-circle (make-posn 560 270) 30 'green)
(draw-circle (make-posn 570 270) 30 'green)
(draw-circle (make-posn 580 270) 30 'green)
(draw-circle (make-posn 590 270) 30 'green)
(draw-circle (make-posn 600 270) 30 'green)
(draw-circle (make-posn 610 270) 30 'green)
(draw-circle (make-posn 620 270) 30 'green)
 ;;bushes left
(draw-circle (make-posn 230 270) 30 'green)
(draw-circle (make-posn 220 270) 30 'green)
(draw-circle (make-posn 210 270) 30 'green)
(draw-circle (make-posn 200 270) 30 'green)
(draw-circle (make-posn 180 270) 30 'green)
(draw-circle (make-posn 170 270) 30 'green)
(draw-circle (make-posn 160 270) 30 'green)
(draw-circle (make-posn 150 270) 30 'green)
(draw-circle (make-posn 140 270) 30 'green)
(draw-circle (make-posn 130 270) 30 'green)
(draw-circle (make-posn 120 270) 30 'green)
(draw-circle (make-posn 110 270) 30 'green)
(draw-circle (make-posn 100 270) 30 'green)
(draw-circle (make-posn 90 270) 30 'green)
(draw-circle (make-posn 80 270) 30 'green)
(draw-circle (make-posn 70 270) 30 'green)
(draw-circle (make-posn 60 270) 30 'green)
(draw-circle (make-posn 50 270) 30 'green)
(draw-circle (make-posn 40 270) 30 'green)
(draw-circle (make-posn 30 270) 30 'green)
(draw-circle (make-posn 20 270) 30 'green)
(draw-circle (make-posn 10 270) 30 'green)
(draw-circle (make-posn 0 270) 30 'green)

Top of page

Present with Ballons made with Robbie
(start 640 480)
(define BACKGROUND
  (and
   (draw-solid-rect(make-posn 0 0)640 480 'black)
   (draw-solid-rect(make-posn 0 450) 640 40 'green)))
(define BALLOONS
  (and
   (draw-circle(make-posn 100 200) 50 'red)
    (draw-circle(make-posn 100 200) 49 'red)
     (draw-circle(make-posn 100 200) 48 'red)
     (draw-solid-line(make-posn 100 250)(make-posn 150 360)'white)
     (draw-solid-disk(make-posn 300 200) 60 'yellow)
     (draw-solid-line(make-posn 300 260)(make-posn 300 300)'white)
     (draw-solid-disk(make-posn 430 300) 50 'blue)
     (draw-solid-line(make-posn 430 340)(make-posn 430 430)'white)))
(define PRESENT
  (and
   (draw-solid-rect(make-posn 150 360) 300 100 'blue)
   (draw-solid-line(make-posn 150 380) (make-posn 447 377) 'red)
   (draw-solid-line(make-posn 150 400) (make-posn 447 400) 'red)
   (draw-circle(make-posn 300 330) 30 'red)
    (draw-circle(make-posn 340 320) 30 'red)
(draw-circle(make-posn 260 320) 30 'red)))

Top of page

Triangle made using proportions
(start 400 300)
;;Tri4:3: N N N -> True
;;make a triangle with a proportion of 4 to 3 sides
(define (rect x y f)
  (and
   (draw-solid-line (make-posn x y) (make-posn (* f 4) y) 'blue)
   (draw-solid-line (make-posn (* f 4) y) (make-posn (* f 4) (* f 3)) 'blue)
   (draw-solid-line (make-posn (* f 4) (* f 3)) (make-posn x (* f 3)) 'blue)
   (draw-solid-line (make-posn x (* f 3)) (make-posn x y) 'blue)))
(rect 0 0 2)
(rect 0 0 4)
(rect 0 0 6)
(rect 0 0 8)
(rect 0 0 10)
(rect 0 0 12)
(rect 0 0 14)
(rect 0 0 16)
(rect 0 0 18)
(rect 0 0 20)
(rect 0 0 22)
(rect 0 0 24)
(rect 0 0 26)
(rect 0 0 28)
(rect 0 0 100)
(rect 0 0 98)
(rect 0 0 96)
(rect 0 0 94)
(rect 0 0 92)
(rect 0 0 90)
(rect 0 0 88)
(rect 0 0 86)
(rect 0 0 84)
(rect 0 0 82)
(rect 0 0 80)
(rect 0 0 78)
(rect 0 0 76)
(rect 0 0 74)
(rect 0 0 72)
(rect 0 0 70)
(rect 0 0 68)
(rect 0 0 66)
(rect 0 0 64)
(rect 0 0 62)
(rect 0 0 60)
(rect 0 0 58)
(rect 0 0 56)
(rect 0 0 54)
(rect 0 0 52)
(rect 0 0 50)
(rect 0 0 48)
(rect 0 0 46)
(rect 0 0 44)
(rect 0 0 42)
(rect 0 0 40)
(rect 0 0 38)
(rect 0 0 36)
(rect 0 0 34)
(rect 0 0 32)
(rect 0 0 30)

;;Tri4:3: N N N -> True
;;make a triangle with a proportion of 4 to 3 sides
(define (tri1 x y f)
  (and
   (draw-solid-line (make-posn (+ x f) y) (make-posn x (+ y f)) 'red)
   (draw-solid-line (make-posn x y) (make-posn (+ x f) y)'red)
   (draw-solid-line (make-posn x (+ y f)) (make-posn x y)'red)))
(tri1 113 85 30)
(tri1 113 85 60)
(tri1 113 85 90)
(tri1 113 85 120)
(tri1 113 85 150)
(tri1 123 95 30)
(tri1 123 95 60)
(tri1 123 95 90)
(tri1 123 95 120)
(tri1 123 95 150)
(tri1 133 105 30)
(tri1 133 105 60)
(tri1 133 105 90)
(tri1 133 105 120)
(tri1 133 105 150)

Top of page