voice - colour"colour2" on top of...

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 voice) (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 1: Voice of Fire image ; ;; Contract: ;; voice-of-fire: colour colour num -> image ; ;; Purpose: to create the voice-of-fire image with colour2 in between the 2 colour1 stripes. Created with overlayed rectangles of width "width", height "5*width" and
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: colour "colour2" on top of width "3*width", height "5*width" and colour "colour1" c ;; Example: (voice-of-fire 5 'blue 'red) => 3 stripes, 2 blue with a red in between, each with width of 5 and height of 25. b ;; Definition: (define (voice-of-fire width colour1 colour2) (overlay (rectangle (* 3 width) (* 5 width) 'solid colour1) (rectangle width (* 5 width) 'solid colour2))) ;; Tests: (check-expect (image? (voice-of-fire 5 'blue 'red)) #T) (voice-of-fire 5 'blue 'red) (check-expect (image-width (voice-of-fire 5 'blue 'red)) 15) (check-expect (image-height (voice-of-fire 5 'blue 'red)) 25)...
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