;; 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 6.6.1) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) (require picturing-programs) ; Worked exercise 6.6.1 ; move-right-10 : image -> image (check-expect (move-right-10 pic:calendar) (beside (rectangle 10 0 "solid" "white") pic:calendar)) (check-expect (move-right-10 (circle 3 "solid" "green")) (beside (rectangle 10 0 "solid" "white") (circle 3 "solid" "green"))) (define (move-right-10 picture) ; picture image (beside (rectangle 10 0 "solid" "white") picture) ) ; move-right-10-on-mouse : image number number mouse-event -> image ; Just like move-right-10, but takes in three extra parameters and ignores them. (check-expect (move-right-10-on-mouse pic:calendar 318 27 "whatever") (beside (rectangle 10 0 "solid" "white") pic:calendar)) (check-expect (move-right-10-on-mouse (circle 3 "solid" "green") -3784 3.7 "blah") (beside (rectangle 10 0 "solid" "white") (circle 3 "solid" "green"))) (define (move-right-10-on-mouse picture x y mouse-event) ; picture image ; x number ; y number ; mouse-event whatever this is (move-right-10 picture) ) (big-bang pic:calendar (on-draw show-it 500 100) (on-mouse move-right-10-on-mouse))