;; The first three lines of this file were inserted by DrRacket. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-beginner-reader.ss" "lang")((modname entry6) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "draw.ss" "teachpack" "htdp"))))) ;; ;;Lab 3 ;;Contract: pos: number number -> boolean ;;Purpose: used to define the location of the body parts of the stick people (define (pos x y) (make-posn x y)) ;;Contract: frame: Person-1 person-1 sleep-for-a-while clear-person-1 clear-person-2 -> structure ;;Purpose: to put all parts of the frame in one easy function (define-struct frame (person-1 person-2 sleep-function clear-person-1 clear-person-2)) ;;Frame 1 Drawing ;;Contract: number number -> boolean ;;Purpose: To make the functions that define the locations of the people in Frame 1 ;;Person 1 ;;Head (define (frame-1-draw-head-1 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-1-draw-body-1 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-1-draw-arms-1 x y) (and (draw-solid-line (pos x (+ y 15)) (pos (+ x 15) (+ y 45)) 'black) (draw-solid-line (pos x (+ y 25)) (pos (+ x 15) (+ y 45)) 'black) )) ;;Legs (define (frame-1-draw-legs-1 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Saber (define (frame-1-draw-saber-1 x y) (and (draw-solid-rect (pos (+ x 13) (+ y 35)) 4 12 'gray) (draw-solid-rect (pos (+ x 13) (- y 30)) 4 65 'red) )) ;;Person 2 ;;Head (define (frame-1-draw-head-2 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-1-draw-body-2 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-1-draw-arms-2 x y) (and (draw-solid-line (pos x (+ y 25)) (pos (- x 10) (+ y 25)) 'black) (draw-solid-line (pos (- x 10) (+ y 25)) (pos (- x 5) (+ y 15)) 'black) (draw-solid-line (pos x (+ y 25)) (pos (+ x 25) y) 'black) (draw-solid-line (pos (+ x 25) y) (pos (+ x 15) y) 'black))) ;;Legs (define (frame-1-draw-legs-2 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Saber (define (frame-1-draw-saber-2 x y) (draw-solid-rect (pos (- x 65) (- y 2)) 50 4 'blue)) ;;Frame 1 clearing ;;Contract: number number -> boolean ;;Purpose: to clear the people in frame 1 ;;Person 1 ;;Head (define (frame-1-clear-head-1 x y) (clear-circle (pos x y) 15 )) ;;Body (define (frame-1-clear-body-1 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) )) ;;Arms (define (frame-1-clear-arms-1 x y) (and (clear-solid-line (pos x (+ y 15)) (pos (+ x 15) (+ y 45)) ) (clear-solid-line (pos x (+ y 25)) (pos (+ x 15) (+ y 45)) ) )) ;;Legs (define (frame-1-clear-legs-1 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) ) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) ) )) ;;Saber (define (frame-1-clear-saber-1 x y) (and (clear-solid-rect (pos (+ x 13) (+ y 35)) 4 12 ) (clear-solid-rect (pos (+ x 13) (- y 30)) 4 65 ) )) ;;Person 2 ;;Head (define (frame-1-clear-head-2 x y) (clear-circle (pos x y) 15)) ;;Body (define (frame-1-clear-body-2 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) )) ;;Arms (define (frame-1-clear-arms-2 x y) (and (clear-solid-line (pos x (+ y 25)) (pos (- x 10) (+ y 25)) ) (clear-solid-line (pos (- x 10) (+ y 25)) (pos (- x 5) (+ y 15)) ) (clear-solid-line (pos x (+ y 25)) (pos (+ x 25) y) ) (clear-solid-line (pos (+ x 25) y) (pos (+ x 15) y) ))) ;;Legs (define (frame-1-clear-legs-2 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) ) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) ) )) ;;Saber (define (frame-1-clear-saber-2 x y) (clear-solid-rect (pos (- x 65) (- y 2)) 50 4 )) ;;Conract: frame-1-person-1: number number -> boolean ;;Purpose: to define person 1 in frame 1 (define (frame-1-person-1 x y) (and (frame-1-draw-head-1 x y) (frame-1-draw-body-1 x y) (frame-1-draw-arms-1 x y) (frame-1-draw-legs-1 x y) (frame-1-draw-saber-1 x y) )) ;;Conract: frame-1-person-2: number number -> boolean ;;Purpose: to define person 2 in frame 1 (define (frame-1-person-2 a b) (and (frame-1-draw-head-2 a b) (frame-1-draw-body-2 a b) (frame-1-draw-legs-2 a b) (frame-1-draw-arms-2 a b) (frame-1-draw-saber-2 a b) )) ;;Contract: clear-frame-1-person-1: number number -> boolean ;;purpose: to clear person 1 in frame 1 (define (clear-frame-1-person-1 x y) (and (frame-1-clear-head-1 x y) (frame-1-clear-body-1 x y) (frame-1-clear-arms-1 x y) (frame-1-clear-legs-1 x y) (frame-1-clear-saber-1 x y) )) ;;Contract: clear-frame-1-person-2: number number -> boolean ;;Purpose: to clear person 2 in frame 1 (define (clear-frame-1-person-2 x y) (and (frame-1-clear-head-2 x y) (frame-1-clear-body-2 x y) (frame-1-clear-arms-2 x y) (frame-1-clear-legs-2 x y) (frame-1-clear-saber-2 x y) )) ;;Frame 2 Draw ;;Contract: number number -> boolean ;;Purpose: to define the locations of the stick people in frame 2 ;;person 1 ;;head (define (frame-2-draw-head-1 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-2-draw-body-1 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-2-draw-arms-1 x y) (and (draw-solid-line (pos x (+ y 15)) (pos (+ x 18) (+ y 12)) 'black) (draw-solid-line (pos x (+ y 25)) (pos (+ x 18) (+ y 12)) 'black) )) ;;Legs (define (frame-2-draw-legs-1 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Saber (define (frame-2-draw-saber-1 x y) (and (draw-solid-line (pos (+ x 18) (+ y 11)) (pos (+ x 22) (+ y 20)) 'gray) (draw-solid-line (pos (+ x 19) (+ y 11)) (pos (+ x 23) (+ y 20)) 'gray) (draw-solid-line (pos (+ x 20) (+ y 11)) (pos (+ x 24) (+ y 20)) 'gray) (draw-solid-line (pos (+ x 17) (+ y 11)) (pos (+ x 21) (+ y 20)) 'gray) (draw-solid-line (pos (+ x 22) (+ y 20)) (pos (+ x 47) (+ y 70)) 'red) (draw-solid-line (pos (+ x 23) (+ y 20)) (pos (+ x 48) (+ y 70)) 'red) (draw-solid-line (pos (+ x 24) (+ y 20)) (pos (+ x 49) (+ y 70)) 'red) (draw-solid-line (pos (+ x 21) (+ y 20)) (pos (+ x 46) (+ y 70)) 'red) )) ;;Person 2 ;Head (define (frame-2-draw-head-2 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-2-draw-body-2 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 40)) 'black)) ;;Legs (define (frame-2-draw-legs-2 x y) (and (draw-solid-line (pos x (+ y 40)) (pos (- x 25) (+ y 40)) 'black) (draw-solid-line (pos (- x 25) (+ y 40)) (pos (- x 25) (+ y 65)) 'black) (draw-solid-line (pos x (+ y 40)) (pos (+ x 25) (+ y 65)) 'black) )) ;;Arms (define (frame-2-draw-arms-2 x y) (draw-solid-line (pos x (+ y 25)) (pos (- x 35) (+ y 25)) 'black)) ;;Saber (define (frame-2-draw-saber-2 x y) (and (draw-solid-rect (pos (- x 45) (+ y 23)) 10 4 'gray) (draw-solid-rect (pos (- x 105) (+ y 23)) 60 4 'blue) )) ;;Contract: frame-2-person-1: number number -> Boolean ;;Purpose: to draw person 1 in frame 2 (define (frame-2-person-1 x y) (and (frame-2-draw-saber-1 x y) (frame-2-draw-head-1 x y) (frame-2-draw-body-1 x y) (frame-2-draw-arms-1 x y) (frame-2-draw-legs-1 x y) )) ;;Contract: frame-2-person-2: number number -> Boolean ;;Purpose: to draw person 2 in frame 2 (define (frame-2-person-2 a b) (and (frame-2-draw-head-2 a b) (frame-2-draw-body-2 a b) (frame-2-draw-legs-2 a b) (frame-2-draw-arms-2 a b) (frame-2-draw-saber-2 a b) )) ;;Frame 2 clear ;;Conract: number number -> boolean ;;Purpose: to clear the frame of people ;;person 1 ;;head (define (frame-2-clear-head-1 x y) (clear-circle (pos x y) 15 )) ;;Body (define (frame-2-clear-body-1 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) )) ;;Arms (define (frame-2-clear-arms-1 x y) (and (clear-solid-line (pos x (+ y 15)) (pos (+ x 18) (+ y 12)) ) (clear-solid-line (pos x (+ y 25)) (pos (+ x 18) (+ y 12)) ) )) ;;Legs (define (frame-2-clear-legs-1 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) ) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) ) )) ;;Saber (define (frame-2-clear-saber-1 x y) (and (clear-solid-line (pos (+ x 18) (+ y 11)) (pos (+ x 22) (+ y 20)) ) (clear-solid-line (pos (+ x 19) (+ y 11)) (pos (+ x 23) (+ y 20)) ) (clear-solid-line (pos (+ x 20) (+ y 11)) (pos (+ x 24) (+ y 20)) ) (clear-solid-line (pos (+ x 17) (+ y 11)) (pos (+ x 21) (+ y 20)) ) (clear-solid-line (pos (+ x 22) (+ y 20)) (pos (+ x 47) (+ y 70)) ) (clear-solid-line (pos (+ x 23) (+ y 20)) (pos (+ x 48) (+ y 70)) ) (clear-solid-line (pos (+ x 24) (+ y 20)) (pos (+ x 49) (+ y 70)) ) (clear-solid-line (pos (+ x 21) (+ y 20)) (pos (+ x 46) (+ y 70)) ) )) ;;Person 2 ;Head (define (frame-2-clear-head-2 x y) (clear-circle (pos x y) 15 'black)) ;;Body (define (frame-2-clear-body-2 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 40)) 'black)) ;;Legs (define (frame-2-clear-legs-2 x y) (and (clear-solid-line (pos x (+ y 40)) (pos (- x 25) (+ y 40)) 'black) (clear-solid-line (pos (- x 25) (+ y 40)) (pos (- x 25) (+ y 65)) 'black) (clear-solid-line (pos x (+ y 40)) (pos (+ x 25) (+ y 65)) 'black) )) ;;Arms (define (frame-2-clear-arms-2 x y) (clear-solid-line (pos x (+ y 25)) (pos (- x 35) (+ y 25)) 'black)) ;;Saber (define (frame-2-clear-saber-2 x y) (and (clear-solid-rect (pos (- x 45) (+ y 23)) 10 4 'gray) (clear-solid-rect (pos (- x 105) (+ y 23)) 60 4 'blue) )) ;;Contract: clear-frame-2-person-1: number number -> boolean ;;Purpose: to put all the clear functions into one easy function (define (clear-frame-2-person-1 x y) (and (frame-2-clear-head-1 x y) (frame-2-clear-body-1 x y) (frame-2-clear-arms-1 x y) (frame-2-clear-legs-1 x y) (frame-2-clear-saber-1 x y) )) ;;Contract: clear-frame-2-person-2: number number -> boolean ;;Purpose: to put all the clear functions into one easy function (define (clear-frame-2-person-2 x y) (and (frame-2-clear-head-2 x y) (frame-2-clear-body-2 x y) (frame-2-clear-arms-2 x y) (frame-2-clear-legs-2 x y) (frame-2-clear-saber-2 x y) )) ;;Frame 3 Draw ;;Contract: number number -> boolean ;;Purpose: TO define the locations of the people in Frame 3 ;;Person 1 ;;Head (define (frame-3-draw-head-1 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-3-draw-body-1 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Legs (define (frame-3-draw-legs-1 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Arms (define (frame-3-draw-arms-1 x y) (and (draw-solid-line (pos x (+ y 20)) (pos (- x 25) (+ y 45)) 'black) (draw-solid-line (pos x (+ y 25)) (pos (- x 25) (+ y 45)) 'black) )) ;;Saber (define (frame-3-draw-saber-1 x y) (and (draw-solid-line (pos (- x 23) (+ y 45)) (pos (- x 29) (+ y 50)) 'gray) (draw-solid-line (pos (- x 24) (+ y 45)) (pos (- x 30) (+ y 50)) 'gray) (draw-solid-line (pos (- x 25) (+ y 45)) (pos (- x 31) (+ y 50)) 'gray) (draw-solid-line (pos (- x 26) (+ y 45)) (pos (- x 32) (+ y 50)) 'gray) (draw-solid-line (pos (- x 27) (+ y 45)) (pos (- x 33) (+ y 50)) 'gray) (draw-solid-line (pos (- x 28) (+ y 45)) (pos (- x 34) (+ y 50)) 'gray) (draw-solid-line (pos (- x 29) (+ y 50)) (pos (- x 64) (+ y 85)) 'red) (draw-solid-line (pos (- x 30) (+ y 50)) (pos (- x 65) (+ y 85)) 'red) (draw-solid-line (pos (- x 31) (+ y 50)) (pos (- x 66) (+ y 85)) 'red) (draw-solid-line (pos (- x 32) (+ y 50)) (pos (- x 67) (+ y 85)) 'red) (draw-solid-line (pos (- x 33) (+ y 50)) (pos (- x 68) (+ y 85)) 'red) (draw-solid-line (pos (- x 34) (+ y 50)) (pos (- x 69) (+ y 85)) 'red) )) ;;Person 2 ;;Head (define (frame-3-draw-head-2 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-3-draw-body-2 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Legs (define (frame-3-draw-legs-2 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Arms (define (frame-3-draw-arms-2 x y) (and (draw-solid-line (pos x (+ y 20)) (pos (+ x 30) (+ y 8)) 'black) (draw-solid-line (pos x (+ y 25)) (pos (+ x 30) (+ y 8)) 'black) )) ;;Saber (define (frame-3-draw-saber-2 x y) (and (draw-solid-line (pos (+ x 30) (+ y 8)) (pos (+ x 38) (+ y 5)) 'gray) (draw-solid-line (pos (+ x 30) (+ y 9)) (pos (+ x 38) (+ y 6)) 'gray) (draw-solid-line (pos (+ x 30) (+ y 10)) (pos (+ x 38) (+ y 7)) 'gray) (draw-solid-line (pos (+ x 30) (+ y 7)) (pos (+ x 38) (+ y 4)) 'gray) (draw-solid-line (pos (+ x 38) (+ y 5)) (pos (+ x 85) (- y 18)) 'blue) (draw-solid-line (pos (+ x 38) (+ y 6)) (pos (+ x 85) (- y 17)) 'blue) (draw-solid-line (pos (+ x 38) (+ y 7)) (pos (+ x 85) (- y 16)) 'blue) (draw-solid-line (pos (+ x 38) (+ y 4)) (pos (+ x 85) (- y 19)) 'blue) )) ;;Frame 3 Clear ;;Contract: number number -> boolean ;;Purpose: to clear frame 3 of people ;;Person 1 ;;Head (define (frame-3-clear-head-1 x y) (clear-circle (pos x y) 15 )) ;;Body (define (frame-3-clear-body-1 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) )) ;;Legs (define (frame-3-clear-legs-1 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) ) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) ) )) ;;Arms (define (frame-3-clear-arms-1 x y) (and (clear-solid-line (pos x (+ y 20)) (pos (- x 25) (+ y 45)) ) (clear-solid-line (pos x (+ y 25)) (pos (- x 25) (+ y 45)) ) )) ;;Saber (define (frame-3-clear-saber-1 x y) (and (clear-solid-line (pos (- x 23) (+ y 45)) (pos (- x 29) (+ y 50)) ) (clear-solid-line (pos (- x 24) (+ y 45)) (pos (- x 30) (+ y 50)) ) (clear-solid-line (pos (- x 25) (+ y 45)) (pos (- x 31) (+ y 50)) ) (clear-solid-line (pos (- x 26) (+ y 45)) (pos (- x 32) (+ y 50)) ) (clear-solid-line (pos (- x 27) (+ y 45)) (pos (- x 33) (+ y 50)) ) (clear-solid-line (pos (- x 28) (+ y 45)) (pos (- x 34) (+ y 50)) ) (clear-solid-line (pos (- x 29) (+ y 50)) (pos (- x 64) (+ y 85)) ) (clear-solid-line (pos (- x 30) (+ y 50)) (pos (- x 65) (+ y 85)) ) (clear-solid-line (pos (- x 31) (+ y 50)) (pos (- x 66) (+ y 85)) ) (clear-solid-line (pos (- x 32) (+ y 50)) (pos (- x 67) (+ y 85)) ) (clear-solid-line (pos (- x 33) (+ y 50)) (pos (- x 68) (+ y 85)) ) (clear-solid-line (pos (- x 34) (+ y 50)) (pos (- x 69) (+ y 85)) ) )) ;;Person 2 ;;Head (define (frame-3-clear-head-2 x y) (clear-circle (pos x y) 15 )) ;;Body (define (frame-3-clear-body-2 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) )) ;;Legs (define (frame-3-clear-legs-2 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) ) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) ) )) ;;Arms (define (frame-3-clear-arms-2 x y) (and (clear-solid-line (pos x (+ y 20)) (pos (+ x 30) (+ y 8)) ) (clear-solid-line (pos x (+ y 25)) (pos (+ x 30) (+ y 8)) ) )) ;;Saber (define (frame-3-clear-saber-2 x y) (and (clear-solid-line (pos (+ x 30) (+ y 8)) (pos (+ x 38) (+ y 5)) ) (clear-solid-line (pos (+ x 30) (+ y 9)) (pos (+ x 38) (+ y 6)) ) (clear-solid-line (pos (+ x 30) (+ y 10)) (pos (+ x 38) (+ y 7)) ) (clear-solid-line (pos (+ x 30) (+ y 7)) (pos (+ x 38) (+ y 4)) ) (clear-solid-line (pos (+ x 38) (+ y 5)) (pos (+ x 85) (- y 18)) ) (clear-solid-line (pos (+ x 38) (+ y 6)) (pos (+ x 85) (- y 17)) ) (clear-solid-line (pos (+ x 38) (+ y 7)) (pos (+ x 85) (- y 16)) ) (clear-solid-line (pos (+ x 38) (+ y 4)) (pos (+ x 85) (- y 19)) ) )) ;;Contract: frame-3-person-1: number number -> boolean ;;Purpose: to define person 1 in frame 3 (define (frame-3-person-1 x y) (and (frame-3-draw-head-1 x y) (frame-3-draw-body-1 x y) (frame-3-draw-legs-1 x y) (frame-3-draw-arms-1 x y) (frame-3-draw-saber-1 x y) )) ;;Contract: frame-3-person-2: number number -> boolean ;;Purpose: to define person 2 in frame 3 (define (frame-3-person-2 a b) (and (frame-3-draw-head-2 a b) (frame-3-draw-body-2 a b) (frame-3-draw-legs-2 a b) (frame-3-draw-arms-2 a b) (frame-3-draw-saber-2 a b) )) ;;Contract: clear-frame-3-person-1: number numebr -> boolean ;;Purpose: to define all the clear functoins into one function (define (clear-frame-3-person-1 x y) (and (frame-3-clear-head-1 x y) (frame-3-clear-body-1 x y) (frame-3-clear-legs-1 x y) (frame-3-clear-arms-1 x y) (frame-3-clear-saber-1 x y) )) ;;Contract: clear-frame-3-person-1: number numebr -> boolean ;;Purpose: to define all the clear functoins into one function (define (clear-frame-3-person-2 x y) (and (frame-3-clear-head-2 x y) (frame-3-clear-body-2 x y) (frame-3-clear-legs-2 x y) (frame-3-clear-arms-2 x y) (frame-3-clear-saber-2 x y) )) ;;Frame 4 Draw ;;Contract: number number -> boolean ;;Purpose: to define the postions of the people in frame 4 ;;Person 1 ;;Head (define (frame-4-draw-head-1 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-4-draw-body-1 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Legs (define (frame-4-draw-legs-1 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Arms (define (frame-4-draw-arms-1 x y) (and (draw-solid-line (pos x (+ y 25)) (pos (+ x 25) (+ y 32)) 'black) (draw-solid-line (pos x (+ y 30)) (pos (+ x 25) (+ y 32)) 'black) )) ;;Saber (define (frame-4-draw-saber-1 x y) (and (draw-solid-line (pos (+ x 27) (+ y 29)) (pos (+ x 23) (+ y 35)) 'gray) (draw-solid-line (pos (+ x 28) (+ y 29)) (pos (+ x 24) (+ y 35)) 'gray) (draw-solid-line (pos (+ x 29) (+ y 29)) (pos (+ x 25) (+ y 35)) 'gray) (draw-solid-line (pos (+ x 30) (+ y 29)) (pos (+ x 26) (+ y 35)) 'gray) (draw-solid-line (pos (+ x 27) (+ y 29)) (pos (+ x 55) (- y 35)) 'red) (draw-solid-line (pos (+ x 28) (+ y 29)) (pos (+ x 56) (- y 35)) 'red) (draw-solid-line (pos (+ x 29) (+ y 29)) (pos (+ x 57) (- y 35)) 'red) (draw-solid-line (pos (+ x 30) (+ y 29)) (pos (+ x 58) (- y 35)) 'red) )) ;;Person 2 ;;Head (define (frame-4-draw-head-2 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-4-draw-body-2 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Legs (define (frame-4-draw-legs-2 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Arms (define (frame-4-draw-arms-2 x y) (and (draw-solid-line (pos x (+ y 25)) (pos (- x 25) (+ y 32)) 'black) (draw-solid-line (pos x (+ y 30)) (pos (- x 25) (+ y 32)) 'black) )) ;;Saber (define (frame-4-draw-saber-2 x y) (and (draw-solid-line (pos (- x 27) (+ y 29)) (pos (- x 23) (+ y 35)) 'gray) (draw-solid-line (pos (- x 28) (+ y 29)) (pos (- x 24) (+ y 35)) 'gray) (draw-solid-line (pos (- x 29) (+ y 29)) (pos (- x 25) (+ y 35)) 'gray) (draw-solid-line (pos (- x 30) (+ y 29)) (pos (- x 26) (+ y 35)) 'gray) (draw-solid-line (pos (- x 27) (+ y 29)) (pos (- x 55) (- y 35)) 'blue) (draw-solid-line (pos (- x 28) (+ y 29)) (pos (- x 56) (- y 35)) 'blue) (draw-solid-line (pos (- x 29) (+ y 29)) (pos (- x 57) (- y 35)) 'blue) (draw-solid-line (pos (- x 30) (+ y 29)) (pos (- x 58) (- y 35)) 'blue) )) ;;Frame 4 Clear ;;Contract: number number -> boolean ;;Purpose: to clear persons 1 and 2 in frame 4 ;;Person 1 ;;Head (define (frame-4-clear-head-1 x y) (clear-circle (pos x y) 15 )) ;;Body (define (frame-4-clear-body-1 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) )) ;;Legs (define (frame-4-clear-legs-1 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) ) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) ) )) ;;Arms (define (frame-4-clear-arms-1 x y) (and (clear-solid-line (pos x (+ y 25)) (pos (+ x 25) (+ y 32)) ) (clear-solid-line (pos x (+ y 30)) (pos (+ x 25) (+ y 32)) ) )) ;;Saber (define (frame-4-clear-saber-1 x y) (and (clear-solid-line (pos (+ x 27) (+ y 29)) (pos (+ x 23) (+ y 35)) ) (clear-solid-line (pos (+ x 28) (+ y 29)) (pos (+ x 24) (+ y 35)) ) (clear-solid-line (pos (+ x 29) (+ y 29)) (pos (+ x 25) (+ y 35)) ) (clear-solid-line (pos (+ x 30) (+ y 29)) (pos (+ x 26) (+ y 35)) ) (clear-solid-line (pos (+ x 27) (+ y 29)) (pos (+ x 55) (- y 35)) ) (clear-solid-line (pos (+ x 28) (+ y 29)) (pos (+ x 56) (- y 35)) ) (clear-solid-line (pos (+ x 29) (+ y 29)) (pos (+ x 57) (- y 35)) ) (clear-solid-line (pos (+ x 30) (+ y 29)) (pos (+ x 58) (- y 35)) ) )) ;;Person 2 ;;Head (define (frame-4-clear-head-2 x y) (clear-circle (pos x y) 15 )) ;;Body (define (frame-4-clear-body-2 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) )) ;;Legs (define (frame-4-clear-legs-2 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) ) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) ) )) ;;Arms (define (frame-4-clear-arms-2 x y) (and (clear-solid-line (pos x (+ y 25)) (pos (- x 25) (+ y 32)) ) (clear-solid-line (pos x (+ y 30)) (pos (- x 25) (+ y 32)) ) )) ;;Saber (define (frame-4-clear-saber-2 x y) (and (clear-solid-line (pos (- x 27) (+ y 29)) (pos (- x 23) (+ y 35)) ) (clear-solid-line (pos (- x 28) (+ y 29)) (pos (- x 24) (+ y 35)) ) (clear-solid-line (pos (- x 29) (+ y 29)) (pos (- x 25) (+ y 35)) ) (clear-solid-line (pos (- x 30) (+ y 29)) (pos (- x 26) (+ y 35)) ) (clear-solid-line (pos (- x 27) (+ y 29)) (pos (- x 55) (- y 35)) ) (clear-solid-line (pos (- x 28) (+ y 29)) (pos (- x 56) (- y 35)) ) (clear-solid-line (pos (- x 29) (+ y 29)) (pos (- x 57) (- y 35)) ) (clear-solid-line (pos (- x 30) (+ y 29)) (pos (- x 58) (- y 35)) ) )) ;;Contract: frame-4-person-1: number number -> boolean ;;Purpose: to define all the draw functions of person 1 into one function (define (frame-4-person-1 x y) (and (frame-4-draw-head-1 x y) (frame-4-draw-body-1 x y) (frame-4-draw-legs-1 x y) (frame-4-draw-arms-1 x y) (frame-4-draw-saber-1 x y) )) ;;Contract: frame-4-person-2: number numbr -> boolean ;;Purpose: to define all the draw functions of person 2 into one function (define (frame-4-person-2 a b) (and (frame-4-draw-head-2 a b) (frame-4-draw-body-2 a b) (frame-4-draw-legs-2 a b) (frame-4-draw-arms-2 a b) (frame-4-draw-saber-2 a b) )) ;;Contract: clear-frame-4-person-1: number number -> boolean ;;Purpose: to define all the clear functions into one nice and easy function (define (clear-frame-4-person-1 x y) (and (frame-4-clear-head-1 x y) (frame-4-clear-body-1 x y) (frame-4-clear-legs-1 x y) (frame-4-clear-arms-1 x y) (frame-4-clear-saber-1 x y) )) ;;Contract: clear-frame-4-person-2: number number -> boolean ;;Purpose: to define all the clear functions into one nice and easy function (define (clear-frame-4-person-2 x y) (and (frame-4-clear-head-2 x y) (frame-4-clear-body-2 x y) (frame-4-clear-legs-2 x y) (frame-4-clear-arms-2 x y) (frame-4-clear-saber-2 x y) )) ;;Frame 5 Drawing ;;Contract: number number -> boolean ;;Purpose: To make the functions that define the locations of the people in Frame 5 ;;Person 1 ;;Head (define (frame-5-draw-head-1 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-5-draw-body-1 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-5-draw-arms-1 x y) (and (draw-solid-line (pos x (+ y 25)) (pos (+ x 25) (+ y 10)) 'black) (draw-solid-line (pos x (+ y 25)) (pos (- x 25) (+ y 10)) 'black) )) ;;Legs (define (frame-5-draw-legs-1 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 50)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 50)) 'black) (draw-solid-line (pos (+ x 12) (+ y 50)) (pos (+ x 20) (+ y 65)) 'black) (draw-solid-line (pos (- x 12) (+ y 50)) (pos (- x 20) (+ y 65)) 'black) )) ;;Saber (define (frame-5-draw-saber-1 x y) (and (draw-solid-rect (pos (+ x 25) (+ y 5)) 4 12 'gray) (draw-solid-rect (pos (+ x 25) (- y 60)) 4 65 'red) )) ;;Person 2 ;;Head (define (frame-5-draw-head-2 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-5-draw-body-2 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-5-draw-arms-2 x y) (draw-solid-line (pos x (+ y 25)) (pos (- x 25) (+ y 25)) 'black)) ;;Legs (define (frame-5-draw-legs-2 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Saber (define (frame-5-draw-saber-2 x y) (and (draw-solid-rect (pos (- x 35) (+ y 23)) 10 4 'gray) (draw-solid-rect (pos (- x 95) (+ y 23)) 60 4 'blue) )) ;;Frame 5 clearing ;;Contract: number number -> boolean ;;Purpose: to clear the people in frame 5 ;;Person 1 ;;Head (define (frame-5-clear-head-1 x y) (clear-circle (pos x y) 15 'black)) ;;Body (define (frame-5-clear-body-1 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-5-clear-arms-1 x y) (and (clear-solid-line (pos x (+ y 25)) (pos (+ x 25) (+ y 10)) 'black) (clear-solid-line (pos x (+ y 25)) (pos (- x 25) (+ y 10)) 'black) )) ;;Legs (define (frame-5-clear-legs-1 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 50)) 'black) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 50)) 'black) (clear-solid-line (pos (+ x 12) (+ y 50)) (pos (+ x 20) (+ y 65)) 'black) (clear-solid-line (pos (- x 12) (+ y 50)) (pos (- x 20) (+ y 65)) 'black) )) ;;Saber (define (frame-5-clear-saber-1 x y) (and (clear-solid-rect (pos (+ x 25) (+ y 5)) 4 12 'gray) (clear-solid-rect (pos (+ x 25) (- y 60)) 4 65 'red) )) ;;Person 2 ;;Head (define (frame-5-clear-head-2 x y) (clear-circle (pos x y) 15 'black)) ;;Body (define (frame-5-clear-body-2 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-5-clear-arms-2 x y) (clear-solid-line (pos x (+ y 25)) (pos (- x 25) (+ y 25)) 'black)) ;;Legs (define (frame-5-clear-legs-2 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Saber (define (frame-5-clear-saber-2 x y) (and (clear-solid-rect (pos (- x 35) (+ y 23)) 10 4 'gray) (clear-solid-rect (pos (- x 95) (+ y 23)) 60 4 'blue) )) ;;Conract: frame-5-person-1: number number -> boolean ;;Purpose: to define person 1 in frame 5 (define (frame-5-person-1 x y) (and (frame-5-draw-head-1 x y) (frame-5-draw-body-1 x y) (frame-5-draw-arms-1 x y) (frame-5-draw-legs-1 x y) (frame-5-draw-saber-1 x y) )) ;;Conract: frame-5-person-2: number number -> boolean ;;Purpose: to define person 2 in frame 5 (define (frame-5-person-2 a b) (and (frame-5-draw-head-2 a b) (frame-5-draw-body-2 a b) (frame-5-draw-legs-2 a b) (frame-5-draw-arms-2 a b) (frame-5-draw-saber-2 a b) )) ;;Contract: clear-frame-5-person-1: number number -> boolean ;;purpose: to clear person 1 in frame 5 (define (clear-frame-5-person-1 x y) (and (frame-5-clear-head-1 x y) (frame-5-clear-body-1 x y) (frame-5-clear-arms-1 x y) (frame-5-clear-legs-1 x y) (frame-5-clear-saber-1 x y) )) ;;Contract: clear-frame-5-person-2: number number -> boolean ;;Purpose: to clear person 2 in frame 5 (define (clear-frame-5-person-2 x y) (and (frame-5-clear-head-2 x y) (frame-5-clear-body-2 x y) (frame-5-clear-arms-2 x y) (frame-5-clear-legs-2 x y) (frame-5-clear-saber-2 x y) )) ;;Frame 6 Draw ;;Contract: number number -> boolean ;;Purpose: to define the people in frame 6 ;;Person 1 ;;Head (define (frame-6-draw-head-1 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-6-draw-body-1 x y) (draw-solid-line (pos (- x 12) (+ y 11)) (pos (- x 45) (+ y 30)) 'black)) ;;Arms (define (frame-6-draw-arms-1 x y) (and (draw-solid-line (pos (- x 16) (+ y 14)) (pos (+ x 10) (+ y 20)) 'black) (draw-solid-line (pos (- x 20) (+ y 17)) (pos (+ x 10) (+ y 20)) 'black) )) ;;Legs (define (frame-6-draw-legs-1 x y) (and (draw-solid-line (pos (- x 45) (+ y 30)) (pos (- x 60) (+ y 30)) 'black) (draw-solid-line (pos (- x 45) (+ y 30)) (pos (- x 55) (+ y 40)) 'black) (draw-solid-line (pos (- x 60) (+ y 30)) (pos (- x 65) (+ y 20)) 'black) (draw-solid-line (pos (- x 55) (+ y 40)) (pos (- x 65) (+ y 35)) 'black) )) ;;Saber (define (frame-6-draw-saber-1 x y) (and (draw-solid-line (pos (+ x 10) (+ y 20)) (pos (+ x 6) (+ y 25)) 'gray) (draw-solid-line (pos (+ x 11) (+ y 20)) (pos (+ x 7) (+ y 25)) 'gray) (draw-solid-line (pos (+ x 12) (+ y 20)) (pos (+ x 8) (+ y 25)) 'gray) (draw-solid-line (pos (+ x 13) (+ y 20)) (pos (+ x 9) (+ y 25)) 'gray) (draw-solid-line (pos (+ x 10) (+ y 20)) (pos (+ x 45) (- y 30)) 'red) (draw-solid-line (pos (+ x 11) (+ y 20)) (pos (+ x 46) (- y 30)) 'red) (draw-solid-line (pos (+ x 12) (+ y 20)) (pos (+ x 47) (- y 30)) 'red) (draw-solid-line (pos (+ x 13) (+ y 20)) (pos (+ x 48) (- y 30)) 'red) )) ;;Person 2 ;;Head (define (frame-6-draw-head-2 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-6-draw-body-2 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-6-draw-arms-2 x y) (and (draw-solid-line (pos x (+ y 25)) (pos (- x 5) (+ y 15)) 'black) (draw-solid-line (pos (- x 15) (- y 4)) (pos (- x 17) (- y 8)) 'black) (draw-solid-line (pos x (+ y 25)) (pos (+ x 10) (+ y 25)) 'black) (draw-solid-line (pos (+ x 10) (+ y 25)) (pos x (+ y 15)) 'black) )) ;;Legs (define (frame-6-draw-legs-2 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Saber (define (frame-6-draw-saber-2 x y) (and (draw-solid-line (pos (- x 17) (- y 8)) (pos (- x 21) (- y 4)) 'gray) (draw-solid-line (pos (- x 18) (- y 8)) (pos (- x 22) (- y 4)) 'gray) (draw-solid-line (pos (- x 19) (- y 8)) (pos (- x 23) (- y 4)) 'gray) (draw-solid-line (pos (- x 16) (- y 8)) (pos (- x 20) (- y 4)) 'gray) (draw-solid-line (pos (- x 21) (- y 4)) (pos (- x 50) (+ y 40)) 'blue) (draw-solid-line (pos (- x 22) (- y 4)) (pos (- x 51) (+ y 40)) 'blue) (draw-solid-line (pos (- x 23) (- y 4)) (pos (- x 52) (+ y 40)) 'blue) (draw-solid-line (pos (- x 20) (- y 4)) (pos (- x 49) (+ y 40)) 'blue) )) ;;Frame 6 Clear ;;Contract: number number -> boolean ;;Purpose: to clear frame 6 ;;Person 1 ;;Head (define (frame-6-clear-head-1 x y) (clear-circle (pos x y) 15 'black)) ;;Body (define (frame-6-clear-body-1 x y) (clear-solid-line (pos (- x 12) (+ y 11)) (pos (- x 45) (+ y 30)) 'black)) ;;Arms (define (frame-6-clear-arms-1 x y) (and (clear-solid-line (pos (- x 16) (+ y 14)) (pos (+ x 10) (+ y 20)) 'black) (clear-solid-line (pos (- x 20) (+ y 17)) (pos (+ x 10) (+ y 20)) 'black) )) ;;Legs (define (frame-6-clear-legs-1 x y) (and (clear-solid-line (pos (- x 45) (+ y 30)) (pos (- x 60) (+ y 30)) 'black) (clear-solid-line (pos (- x 45) (+ y 30)) (pos (- x 55) (+ y 40)) 'black) (clear-solid-line (pos (- x 60) (+ y 30)) (pos (- x 65) (+ y 20)) 'black) (clear-solid-line (pos (- x 55) (+ y 40)) (pos (- x 65) (+ y 35)) 'black) )) ;;Saber (define (frame-6-clear-saber-1 x y) (and (clear-solid-line (pos (+ x 10) (+ y 20)) (pos (+ x 6) (+ y 25)) 'gray) (clear-solid-line (pos (+ x 11) (+ y 20)) (pos (+ x 7) (+ y 25)) 'gray) (clear-solid-line (pos (+ x 12) (+ y 20)) (pos (+ x 8) (+ y 25)) 'gray) (clear-solid-line (pos (+ x 13) (+ y 20)) (pos (+ x 9) (+ y 25)) 'gray) (clear-solid-line (pos (+ x 10) (+ y 20)) (pos (+ x 45) (- y 30)) 'red) (clear-solid-line (pos (+ x 11) (+ y 20)) (pos (+ x 46) (- y 30)) 'red) (clear-solid-line (pos (+ x 12) (+ y 20)) (pos (+ x 47) (- y 30)) 'red) (clear-solid-line (pos (+ x 13) (+ y 20)) (pos (+ x 48) (- y 30)) 'red) )) ;;Person 2 ;;Head (define (frame-6-clear-head-2 x y) (clear-circle (pos x y) 15 'black)) ;;Body (define (frame-6-clear-body-2 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-6-clear-arms-2 x y) (and (clear-solid-line (pos x (+ y 25)) (pos (- x 5) (+ y 15)) 'black) (clear-solid-line (pos (- x 15) (- y 4)) (pos (- x 17) (- y 8)) 'black) (clear-solid-line (pos x (+ y 25)) (pos (+ x 10) (+ y 25)) 'black) (clear-solid-line (pos (+ x 10) (+ y 25)) (pos x (+ y 15)) 'black) )) ;;Legs (define (frame-6-clear-legs-2 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Saber (define (frame-6-clear-saber-2 x y) (and (clear-solid-line (pos (- x 17) (- y 8)) (pos (- x 21) (- y 4)) 'gray) (clear-solid-line (pos (- x 18) (- y 8)) (pos (- x 22) (- y 4)) 'gray) (clear-solid-line (pos (- x 19) (- y 8)) (pos (- x 23) (- y 4)) 'gray) (clear-solid-line (pos (- x 16) (- y 8)) (pos (- x 20) (- y 4)) 'gray) (clear-solid-line (pos (- x 21) (- y 4)) (pos (- x 50) (+ y 40)) 'blue) (clear-solid-line (pos (- x 22) (- y 4)) (pos (- x 51) (+ y 40)) 'blue) (clear-solid-line (pos (- x 23) (- y 4)) (pos (- x 52) (+ y 40)) 'blue) (clear-solid-line (pos (- x 20) (- y 4)) (pos (- x 49) (+ y 40)) 'blue) )) ;;Contract: frame-6-person-1: number number -> boolean ;;Purpose: to define all the draw functions into one simple function (define (frame-6-person-1 x y) (and (frame-6-draw-head-1 x y) (frame-6-draw-body-1 x y) (frame-6-draw-arms-1 x y) (frame-6-draw-legs-1 x y) (frame-6-draw-saber-1 x y) )) ;;Contract: frame-6-person-2: number number -> boolean ;;Purpose: to define person 2 in frame 6 into one easy function (define (frame-6-person-2 x y) (and (frame-6-draw-head-2 x y) (frame-6-draw-body-2 x y) (frame-6-draw-arms-2 x y) (frame-6-draw-legs-2 x y) (frame-6-draw-saber-2 x y) )) ;;Contract: clear-frame-6-person-1 ;;Purpose: to clear person 1 in frame 6 (define (clear-frame-6-person-1 x y) (and (frame-6-clear-head-1 x y) (frame-6-clear-body-1 x y) (frame-6-clear-arms-1 x y) (frame-6-clear-legs-1 x y) (frame-6-clear-saber-1 x y) )) ;;Contract: clear-frame-6-person-2 ;;Purpose: to clear person 2 in frame 6 (define (clear-frame-6-person-2 x y) (and (frame-6-clear-head-2 x y) (frame-6-clear-body-2 x y) (frame-6-clear-arms-2 x y) (frame-6-clear-legs-2 x y) (frame-6-clear-saber-2 x y) )) ;;Frame 7 Draw ;;Contract: number number -> boolean ;;Purpose: To define the locations of the people in Frame 7 ;;Person 1 ;;Head (define (frame-7-draw-head-1 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-7-draw-body-1 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Legs (define (frame-7-draw-legs-1 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Arms (define (frame-7-draw-arms-1 x y) (and (draw-solid-line (pos x (+ y 20)) (pos (+ x 30) (+ y 28)) 'black) (draw-solid-line (pos x (+ y 25)) (pos (+ x 15) (+ y 33)) 'black) (draw-solid-line (pos (+ x 15) (+ y 33)) (pos (+ x 30) (+ y 28)) 'black) )) ;;Saber (define (frame-7-draw-saber-1 x y) (and (draw-solid-line (pos (+ x 30) (+ y 27)) (pos (+ x 38) (+ y 25)) 'gray) (draw-solid-line (pos (+ x 30) (+ y 28)) (pos (+ x 38) (+ y 26)) 'gray) (draw-solid-line (pos (+ x 30) (+ y 29)) (pos (+ x 38) (+ y 27)) 'gray) (draw-solid-line (pos (+ x 30) (+ y 26)) (pos (+ x 38) (+ y 24)) 'gray) (draw-solid-line (pos (+ x 38) (+ y 25)) (pos (+ x 80) (+ y 15)) 'red) (draw-solid-line (pos (+ x 38) (+ y 26)) (pos (+ x 80) (+ y 16)) 'red) (draw-solid-line (pos (+ x 38) (+ y 27)) (pos (+ x 80) (+ y 17)) 'red) (draw-solid-line (pos (+ x 38) (+ y 24)) (pos (+ x 80) (+ y 14)) 'red) )) ;;Person 2 ;;Head (define (frame-7-draw-head-2 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-7-draw-body-2 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-7-draw-arms-2 x y) (and (draw-solid-line (pos x (+ y 25)) (pos (- x 5) (+ y 15)) 'black) (draw-solid-line (pos (- x 15) (- y 4)) (pos (- x 17) (- y 8)) 'black) (draw-solid-line (pos x (+ y 25)) (pos (+ x 10) (+ y 25)) 'black) (draw-solid-line (pos (+ x 10) (+ y 25)) (pos x (+ y 15)) 'black) )) ;;Legs (define (frame-7-draw-legs-2 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Saber (define (frame-7-draw-saber-2 x y) (and (draw-solid-line (pos (- x 17) (- y 8)) (pos (- x 21) (- y 4)) 'gray) (draw-solid-line (pos (- x 18) (- y 8)) (pos (- x 22) (- y 4)) 'gray) (draw-solid-line (pos (- x 19) (- y 8)) (pos (- x 23) (- y 4)) 'gray) (draw-solid-line (pos (- x 16) (- y 8)) (pos (- x 20) (- y 4)) 'gray) (draw-solid-line (pos (- x 21) (- y 4)) (pos (- x 50) (+ y 40)) 'blue) (draw-solid-line (pos (- x 22) (- y 4)) (pos (- x 51) (+ y 40)) 'blue) (draw-solid-line (pos (- x 23) (- y 4)) (pos (- x 52) (+ y 40)) 'blue) (draw-solid-line (pos (- x 20) (- y 4)) (pos (- x 49) (+ y 40)) 'blue) )) ;;Frame 7 Clearing ;;Contract: number number -> boolean ;;Purpose: To clear the locations of the people in Frame 7 ;;Person 1 ;;Head (define (frame-7-clear-head-1 x y) (clear-circle (pos x y) 15 'black)) ;;Body (define (frame-7-clear-body-1 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Legs (define (frame-7-clear-legs-1 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Arms (define (frame-7-clear-arms-1 x y) (and (clear-solid-line (pos x (+ y 20)) (pos (+ x 30) (+ y 28)) 'black) (clear-solid-line (pos x (+ y 25)) (pos (+ x 15) (+ y 33)) 'black) (clear-solid-line (pos (+ x 15) (+ y 33)) (pos (+ x 30) (+ y 28)) 'black) )) ;;Saber (define (frame-7-clear-saber-1 x y) (and (clear-solid-line (pos (+ x 30) (+ y 27)) (pos (+ x 38) (+ y 25)) 'gray) (clear-solid-line (pos (+ x 30) (+ y 28)) (pos (+ x 38) (+ y 26)) 'gray) (clear-solid-line (pos (+ x 30) (+ y 29)) (pos (+ x 38) (+ y 27)) 'gray) (clear-solid-line (pos (+ x 30) (+ y 26)) (pos (+ x 38) (+ y 24)) 'gray) (clear-solid-line (pos (+ x 38) (+ y 25)) (pos (+ x 80) (+ y 15)) 'red) (clear-solid-line (pos (+ x 38) (+ y 26)) (pos (+ x 80) (+ y 16)) 'red) (clear-solid-line (pos (+ x 38) (+ y 27)) (pos (+ x 80) (+ y 17)) 'red) (clear-solid-line (pos (+ x 38) (+ y 24)) (pos (+ x 80) (+ y 14)) 'red) )) ;;Person 2 ;;Head (define (frame-7-clear-head-2 x y) (clear-circle (pos x y) 15 'black)) ;;Body (define (frame-7-clear-body-2 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Arms (define (frame-7-clear-arms-2 x y) (and (clear-solid-line (pos x (+ y 25)) (pos (- x 5) (+ y 15)) 'black) (clear-solid-line (pos (- x 15) (- y 4)) (pos (- x 17) (- y 8)) 'black) (clear-solid-line (pos x (+ y 25)) (pos (+ x 10) (+ y 25)) 'black) (clear-solid-line (pos (+ x 10) (+ y 25)) (pos x (+ y 15)) 'black) )) ;;Legs (define (frame-7-clear-legs-2 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Saber (define (frame-7-clear-saber-2 x y) (and (clear-solid-line (pos (- x 17) (- y 8)) (pos (- x 21) (- y 4)) 'gray) (clear-solid-line (pos (- x 18) (- y 8)) (pos (- x 22) (- y 4)) 'gray) (clear-solid-line (pos (- x 19) (- y 8)) (pos (- x 23) (- y 4)) 'gray) (clear-solid-line (pos (- x 16) (- y 8)) (pos (- x 20) (- y 4)) 'gray) (clear-solid-line (pos (- x 21) (- y 4)) (pos (- x 50) (+ y 40)) 'blue) (clear-solid-line (pos (- x 22) (- y 4)) (pos (- x 51) (+ y 40)) 'blue) (clear-solid-line (pos (- x 23) (- y 4)) (pos (- x 52) (+ y 40)) 'blue) (clear-solid-line (pos (- x 20) (- y 4)) (pos (- x 49) (+ y 40)) 'blue) )) ;;Contract: frame-7-person-1: number number -> boolean ;;Purpose: to define person 1 in frame 7 (define (frame-7-person-1 x y) (and (frame-7-draw-head-1 x y) (frame-7-draw-body-1 x y) (frame-7-draw-legs-1 x y) (frame-7-draw-arms-1 x y) (frame-7-draw-saber-1 x y) )) ;;Contract: frame-7-person-2: number number -> boolean ;;Purpose: to define person 2 in frame 7 into one easy function (define (frame-7-person-2 x y) (and (frame-7-draw-head-2 x y) (frame-7-draw-body-2 x y) (frame-7-draw-arms-2 x y) (frame-7-draw-legs-2 x y) (frame-7-draw-saber-2 x y) )) ;;Contract: clear-frame-7-person-1 ;;Purpose: to clear person 1 in frame 7 (define (clear-frame-7-person-1 x y) (and (frame-7-clear-head-1 x y) (frame-7-clear-body-1 x y) (frame-7-clear-arms-1 x y) (frame-7-clear-legs-1 x y) (frame-7-clear-saber-1 x y) )) ;;Contract: clear-frame-7-person-2 ;;Purpose: to clear person 2 in frame 7 (define (clear-frame-7-person-2 x y) (and (frame-7-clear-head-2 x y) (frame-7-clear-body-2 x y) (frame-7-clear-arms-2 x y) (frame-7-clear-legs-2 x y) (frame-7-clear-saber-2 x y) )) ;;Frame 8 Draw ;;Person 1 ;;Head (define (frame-8-draw-head-1 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-8-draw-body-1 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Legs (define (frame-8-draw-legs-1 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Arms (define (frame-8-draw-arms-1 x y) (and (draw-solid-line (pos x (+ y 25)) (pos (+ x 25) (+ y 32)) 'black) (draw-solid-line (pos x (+ y 30)) (pos (+ x 25) (+ y 32)) 'black) )) ;;Saber (define (frame-8-draw-saber-1 x y) (and (draw-solid-line (pos (+ x 27) (+ y 29)) (pos (+ x 23) (+ y 35)) 'gray) (draw-solid-line (pos (+ x 28) (+ y 29)) (pos (+ x 24) (+ y 35)) 'gray) (draw-solid-line (pos (+ x 29) (+ y 29)) (pos (+ x 25) (+ y 35)) 'gray) (draw-solid-line (pos (+ x 30) (+ y 29)) (pos (+ x 26) (+ y 35)) 'gray) (draw-solid-line (pos (+ x 27) (+ y 29)) (pos (+ x 55) (- y 35)) 'red) (draw-solid-line (pos (+ x 28) (+ y 29)) (pos (+ x 56) (- y 35)) 'red) (draw-solid-line (pos (+ x 29) (+ y 29)) (pos (+ x 57) (- y 35)) 'red) (draw-solid-line (pos (+ x 30) (+ y 29)) (pos (+ x 58) (- y 35)) 'red) )) ;;Person 2 ;;Head (define (frame-8-draw-head-2 x y) (draw-circle (pos x y) 15 'black)) ;;Body (define (frame-8-draw-body-2 x y) (draw-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Legs (define (frame-8-draw-legs-2 x y) (and (draw-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (draw-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Arms (define (frame-8-draw-arms-2 x y) (and (draw-solid-line (pos x (+ y 25)) (pos (- x 25) (+ y 32)) 'black) (draw-solid-line (pos x (+ y 30)) (pos (- x 25) (+ y 32)) 'black) )) ;;Saber (define (frame-8-draw-saber-2 x y) (and (draw-solid-line (pos (- x 27) (+ y 29)) (pos (- x 23) (+ y 35)) 'gray) (draw-solid-line (pos (- x 28) (+ y 29)) (pos (- x 24) (+ y 35)) 'gray) (draw-solid-line (pos (- x 29) (+ y 29)) (pos (- x 25) (+ y 35)) 'gray) (draw-solid-line (pos (- x 30) (+ y 29)) (pos (- x 26) (+ y 35)) 'gray) (draw-solid-line (pos (- x 27) (+ y 29)) (pos (- x 55) (- y 35)) 'blue) (draw-solid-line (pos (- x 28) (+ y 29)) (pos (- x 56) (- y 35)) 'blue) (draw-solid-line (pos (- x 29) (+ y 29)) (pos (- x 57) (- y 35)) 'blue) (draw-solid-line (pos (- x 30) (+ y 29)) (pos (- x 58) (- y 35)) 'blue) )) ;;Frame 8 Clear ;;Contract: number number -> boolean ;;Purpose: To clear frame 8 ;;Person 1 ;;Head (define (frame-8-clear-head-1 x y) (clear-circle (pos x y) 15 'black)) ;;Body (define (frame-8-clear-body-1 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Legs (define (frame-8-clear-legs-1 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Arms (define (frame-8-clear-arms-1 x y) (and (clear-solid-line (pos x (+ y 25)) (pos (+ x 25) (+ y 32)) 'black) (clear-solid-line (pos x (+ y 30)) (pos (+ x 25) (+ y 32)) 'black) )) ;;Saber (define (frame-8-clear-saber-1 x y) (and (clear-solid-line (pos (+ x 27) (+ y 29)) (pos (+ x 23) (+ y 35)) 'gray) (clear-solid-line (pos (+ x 28) (+ y 29)) (pos (+ x 24) (+ y 35)) 'gray) (clear-solid-line (pos (+ x 29) (+ y 29)) (pos (+ x 25) (+ y 35)) 'gray) (clear-solid-line (pos (+ x 30) (+ y 29)) (pos (+ x 26) (+ y 35)) 'gray) (clear-solid-line (pos (+ x 27) (+ y 29)) (pos (+ x 55) (- y 35)) 'red) (clear-solid-line (pos (+ x 28) (+ y 29)) (pos (+ x 56) (- y 35)) 'red) (clear-solid-line (pos (+ x 29) (+ y 29)) (pos (+ x 57) (- y 35)) 'red) (clear-solid-line (pos (+ x 30) (+ y 29)) (pos (+ x 58) (- y 35)) 'red) )) ;;Person 2 ;;Head (define (frame-8-clear-head-2 x y) (clear-circle (pos x y) 15 'black)) ;;Body (define (frame-8-clear-body-2 x y) (clear-solid-line (pos x (+ y 15)) (pos x (+ y 60)) 'black)) ;;Legs (define (frame-8-clear-legs-2 x y) (and (clear-solid-line (pos x (+ y 60)) (pos (+ x 12) (+ y 85)) 'black) (clear-solid-line (pos x (+ y 60)) (pos (- x 12) (+ y 85)) 'black) )) ;;Arms (define (frame-8-clear-arms-2 x y) (and (clear-solid-line (pos x (+ y 25)) (pos (- x 25) (+ y 32)) 'black) (clear-solid-line (pos x (+ y 30)) (pos (- x 25) (+ y 32)) 'black) )) ;;Saber (define (frame-8-clear-saber-2 x y) (and (clear-solid-line (pos (- x 27) (+ y 29)) (pos (- x 23) (+ y 35)) 'gray) (clear-solid-line (pos (- x 28) (+ y 29)) (pos (- x 24) (+ y 35)) 'gray) (clear-solid-line (pos (- x 29) (+ y 29)) (pos (- x 25) (+ y 35)) 'gray) (clear-solid-line (pos (- x 30) (+ y 29)) (pos (- x 26) (+ y 35)) 'gray) (clear-solid-line (pos (- x 27) (+ y 29)) (pos (- x 55) (- y 35)) 'blue) (clear-solid-line (pos (- x 28) (+ y 29)) (pos (- x 56) (- y 35)) 'blue) (clear-solid-line (pos (- x 29) (+ y 29)) (pos (- x 57) (- y 35)) 'blue) (clear-solid-line (pos (- x 30) (+ y 29)) (pos (- x 58) (- y 35)) 'blue) )) ;;Contract: frame-8-person-1: number number -> boolean ;;Purpose: to draw person 1 in frame 8 (define (frame-8-person-1 x y) (and (frame-8-draw-head-1 x y) (frame-8-draw-body-1 x y) (frame-8-draw-legs-1 x y) (frame-8-draw-arms-1 x y) (frame-8-draw-saber-1 x y) )) ;;Contract: frame-8-person-2: number number -> boolean ;;Purpose: to draw person 2 in frame 8 (define (frame-8-person-2 x y) (and (frame-8-draw-head-2 x y) (frame-8-draw-body-2 x y) (frame-8-draw-legs-2 x y) (frame-8-draw-arms-2 x y) (frame-8-draw-saber-2 x y) )) ;;Contract: clear-frame-8-person-1: number number -> boolean ;;Purpose: to clear person 1 in Frame 8 (define (clear-frame-8-person-1 x y) (and (frame-8-clear-head-1 x y) (frame-8-clear-body-1 x y) (frame-8-clear-legs-1 x y) (frame-8-clear-arms-1 x y) (frame-8-clear-saber-1 x y) )) ;;Contract: clear-frame-8-person-2: number number -> boolean ;;Purpose: to clear person 2 in Frame 8 (define (clear-frame-8-person-2 x y) (and (frame-8-clear-head-2 x y) (frame-8-clear-body-2 x y) (frame-8-clear-legs-2 x y) (frame-8-clear-arms-2 x y) (frame-8-clear-saber-2 x y) )) (define (frame-1 x y a b) (make-frame (frame-1-person-1 x y) (frame-1-person-2 a b) (sleep-for-a-while .5) (clear-frame-1-person-1 x y) (clear-frame-1-person-2 a b))) (define (frame-2 x y a b) (make-frame (frame-2-person-1 x y) (frame-2-person-2 a b) (sleep-for-a-while .5) (clear-frame-2-person-1 x y) (clear-frame-2-person-2 a b))) (define (frame-3 x y a b) (make-frame (frame-3-person-1 x y) (frame-3-person-2 a b) (sleep-for-a-while .5) (clear-frame-3-person-1 x y) (clear-frame-3-person-2 a b))) (define (frame-4 x y a b) (make-frame (frame-4-person-1 x y) (frame-4-person-2 a b) (sleep-for-a-while .5) (clear-frame-4-person-1 x y) (clear-frame-4-person-2 a b))) (define (frame-5 x y a b) (make-frame (frame-5-person-1 x y) (frame-5-person-2 a b) (sleep-for-a-while .5) (clear-frame-5-person-1 x y) (clear-frame-5-person-2 a b))) (define (frame-6 x y a b) (make-frame (frame-6-person-1 x y) (frame-6-person-2 a b) (sleep-for-a-while .5) (clear-frame-6-person-1 x y) (clear-frame-6-person-2 a b))) (define (frame-7 x y a b) (make-frame (frame-7-person-1 x y) (frame-7-person-2 a b) (sleep-for-a-while .5) (clear-frame-7-person-1 x y) (clear-frame-7-person-2 a b))) (define (frame-8 x y a b) (make-frame (frame-8-person-1 x y) (frame-8-person-2 a b) (sleep-for-a-while .5) (clear-frame-8-person-1 x y) (clear-frame-8-person-2 a b))) (start 500 300) (frame-1 150 200 350 200) (frame-2 150 200 280 220) (frame-3 150 200 280 200) (frame-4 200 200 280 200) (frame-5 230 150 300 200) (frame-6 230 200 300 200) (frame-7 210 200 300 200) (frame-8 150 200 350 200) (sleep-for-a-while .5) (stop)