This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS 135 Fall 2005 Prabhakar Ragde Assignment 1 Due Friday, September 23, 12 noon For this and all subsequent assignments you are expected to use the design recipe as discussed in class when you are writing functions from scratch. The solutions you submit must be entirely your own work. Do not look up either full or partial solutions on the Internet or in printed sources. Please read the course Web page for more information on assignment policies and how to submit your work. Language level : Beginning Student. Each assignment will start with a list of warmup exercises. You don’t need to submit these, but we advise you to do them to practice concepts discussed in lectures before doing the assignment. This week’s warmup exercises are HtDP exercises 3.3.2, 3.3.3, 3.3.4, 4.1.1, 4.1.2, 4.2.1, and 4.2.2. Here are the assignment questions you need to submit. Questions 1 through 4 require the fab- ric teachpack, which you can download from the course Web page. You will need to load it into DrScheme and read the documentation (also available from the course Web page) on the functions it provides. Where the design recipe specifies examples in questions 1 through 4, simply provide a sample application and briefly describe its output. 1. Write a function two-vert-stripe that consumes two colours, a number representing width, and an image, and produces an image of the same size with alternating vertical stripes of the given width in the two colours. 2. Write a function stack that consumes two images and produces an image which consists of the first image just above the second image, with their left edges lined up. Then write a function side-by-side that consumes two images and produces an image which consists of the first image just to the left of the second image, with their top edges lined up. 3. Write a function four-check that consumes two colours and a number representing width, and produces a 2 by 2 checkerboard in those colours (alternating in each row and column), with each of the four squares being the given width. Then write a function checkered-fabric that consumes two colours, a number representing width, and an image, and produces a checkered image of the same size as the image, with squares of the given colours, each solid-coloured square being of the given width....
View Full Document
This note was uploaded on 12/16/2011 for the course CS 135 taught by Professor Vasiga during the Fall '07 term at Waterloo.
- Fall '07