From evans@virginia.edu Mon Jan 21 22:19:52 2002 Date: Mon, 21 Jan 2002 15:10:25 -0500 (EST) From: David Evans To: cs200-students@cs.virginia.edu Subject: PS1 Hints Hi all, I hope everyone has had a chance to make some good progress on PS1. Although it may seem very long and hard (and is), I know several teams were able to finish it Sunday night, so it is definitely possible and I am confident everyone will be able to finish it successfully as long as you don't wait too late to get started. There will be staffed lab hours Wednesday 6-9pm in Small Hall (Spiff), and 5-9pm in Cocke ITC lab (Portman). There are not likely to be any staff available to help Thursday night, so you are advised to definitely take advantage of the time Wednesday. Here are a few hints for PS1 based on questions that have come up so far: o If you use Netscape, clicking on the mosaic.ss link on the problem set will not download the code, but instead will open up mosaic.ss in a Netscape window. You can then to File | Save As to save mosaic.ss to a local file. o The path-name definition in mosaic.ss was "K:/cs200/ps1", but your home directory is probably "J:" instead of "K:". If this is the case, you need to change the definition near the top of mosaic.ss: (define path-name "K:/cs200/ps1/") should be (define path-name "J:/cs200/ps1/") (This is changed in the code to download now.) o For Question 4, the second parameter you need to sent to produce-tiles-page is a list of list of images. A list is an ordered collection of items. Lists can be made up of any Scheme object including numbers, words, pictures, or even other lists. The basic syntax to define a list is: (define my-list (list 1 2 (list 2 0 0))) This will create a list called my-list containing the three elements 1, 2 and the list containing the three elements 2 0 0. Question 4 requires you to define a list of lists, or a two-dimensional list as one of the parameters for produce-tiles-page. You can do this by creating a list containing the names of picture files (ex. "J:/cs200/ps1/uvaimages/rotunda1.jpg"), then create another list with first list as one of its elements. We will cover lists in class a bit later in more detail. o It is a good idea to try and test your closer-color? function separately, instead of just by trying (make-rotundasaic "J:/cs200/ps1/output.html" closer-color?) You can do this by evaluating applications of closer-color? directly in the Interactions window. I won't tell you exactly how to do this, but think about things you can pass as parameters to closer-color? and what the expected result should be. ;; What can you put in the and places ;; so that you expect closer-color? to evaluate to #t? (closer-color? (make-color 0 0 0) ) > #t ;; Also, try some that should evaluate to #f Happy Scheming, --- Dave