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

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 "htdp-beginner-reader.ss" "lang")((modname mm) (read-case-sensitive #t) (teachpacks ((lib "image.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "image.ss" "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

Ask a homework question - tutors are online