mm - the head and"head/2" for the ears Created...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
;; The first three lines of this file were inserted by DrScheme. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "" "lang")((modname mm) (read-case-sensitive #t) (teachpacks ((lib "" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "" "teachpack" "htdp"))))) ;; Ru Wang 20319247 CS 135 section 001 tut 108 ; ;; Question 2: mickey-mouse image ; ;; Contract: ;; mickey-mouse: num colour -> image ; ;; Purpose: creating a mickey mouse head out of 3 circles: with radius "head" for
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the head and "head/2" for the ears. Created using the overlay and move-pinhole functions. f ;; Example: (mickey-mouse 50 'black) => a black mickey mouse head ; ;; Definition: (define (mickey-mouse head colour) (overlay (circle head 'solid colour) (move-pinhole (circle (/ head 2) 'solid colour) head head) (move-pinhole (circle (/ head 2) 'solid colour) (* -1 head) head))) ;; Tests: (check-expect (image? (mickey-mouse 50 'black)) #T) (mickey-mouse 50 'black) (check-expect (image-width (mickey-mouse 50 'black)) 150) (check-expect (image-height (mickey-mouse 50 'black)) 125)...
View Full Document

This note was uploaded on 10/21/2010 for the course CS 135 taught by Professor Vasiga during the Fall '07 term at Waterloo.

Ask a homework question - tutors are online