CSC151 2009F, Class 11: A Design Perspective Admin: * Thursday evening is HS homecoming in Grinnell (starting at 5:30 in Central Park). If you've never been to a small-town homecoming parade, it's worth seeing. * Lab writeups are supposed to be quick (under one hour). If you're spending more than an hour on it, you need to STOP! * Final in-class chance for questions on assignment 3.q * Guest teacher: Matthew Kluber Overview: * Approaching colors. * Managing the huge palette. * Other design issues. Questions on Assignment 3: * What's the best you can do for a red/black checkerboard drawing? * [Answer is same as email.] * We'll start with some assumptions * Assumption 1: We only count words and numbers (not the parens), but we do count lambda, define, and any names we use * Assumption 2: In addition to the unit square and circle (and standard Scheme keywords) we can use * drawing-group * drawing-height * drawing-hscale * drawing-hshift * drawing-recolor * drawing-scale * drawing-shift * drawing-vscale * drawing-vshift * drawing-width * Assumption 3: Our final command is (define checkerboard ...) * That means we need to count 2 for the "define checkerboard" * Assumption 4: We can draw any size checkboard we find easiest. * Given all those assumptions, my first natural solution (for a really small board) required 48 words. * One of my colleagues gave me a tip that led to a 43-word solution. * A bit more work led to a 40-word solution. * The first solution a student submitted (which made each square 10 wide) had 57 words * I'd need to scale mine to get that, which means two more words. * Can we use the context-set-bgcolor! procedure? * NO * I'm not entirely sure what you mean by "include this documentation along with your definition of the procedure"in question 1. I copy pasted the procedure above my code but I wasn't entirely sure if that's what you wanted. * That's exactly what I wanted. ;;; Procedure: ;;; shadow ;;; Parameters: ;;; drawing, a drawing ;;; Purpose: ;;; Create a shadow for drawing. ;;; Produces: ;;; my-shadow, a drawing ;;; Preconditions: ;;; No additional. ;;; Postconditions: ;;; my-shadow is the same size and shape as drawing. ;;; my-shadow is colored grey. ;;; my-shadow is shifted up by 3 units and left by 6 units ;;; relative to the position of drawing. (define shadow (lambda (drawing) ...)) * For the checkerboard, do we need to include the (image-show (drawing->image checkerboard) 8 8) command in the definitions panel or is it assumed that that's what we type in to display checkerboard. In other words, does the above code count for words and should we include it? * The above code does not count. You're creating the drawing, not the image. * For Problem 3, I already wrote code for the last lab write-up (for an extra section) that is exactly what problem 3 asks for. Is it all right if I use this code (I would site [sic] the previous lab)? * As long as you cite, it's fine. * I don't have a partner yet, what do I do? * Come talk to me at the end of class. * How many squares in the checkerboard: 64 (32 red, 32 black) Kluber on Kolor * Useful Web sites ** http://colorschemedesigner.com ** http://www.colormatters.com/colortheory.html