CSC151 2009F, Class 19: Pause for Breath Admin: * Please keep your partners from yesterday (through this week). * I will not have office hours on Wednesday. Sorry. Send me email. * It appears that I will not be able to return exams until Friday. I apologize for the delay. * Are there questions on Assignment 4? * I've been told that it was generating a bit of profanity last evening. * EC for attending some part of the Rosenfield anniversary symposium on Thursday. * Don't forget about the history of programming languages talk at noon on Friday in 3821. * Info at http://www.drupal.cs.grinnell.edu Overview: * Exploring part 4 of assignment 4 Confusion from Assignment 4 * Mostly about the map procedure and how it interacts with other things * Problem mostly in more complex expressions * Possible solution: * Build up the more complex solution bit-by-bit * Test parts along the way * Test the built-up solution along the way * And doing multiple things at once * Build it up part by part * Difference between drawing-group and drawing-compose * The first works with drawings, the second with list * Issues with rendering * Agh! drawing->image and image-show and ...! * Solution? BUild the rendering procedure once and then forget about the component parts tep one: Make an "interesting" list of shapes (define numpoints1 32) (define hshifts1 (map (l-s * 10) (iota numpoints1))) ; divide by 10, compute the sine, multiply by 100, add 100 (define vshifts1 (map (o (l-s + 100) (l-s * 100) sin (r-s / 3)) (iota numpoints1))) (define diameters1 (map (o (l-s * 3) increment (r-s mod 5)) (iota numpoints1))) (define blendy-list (lambda (rgb1 rgb2 steps) (map (lambda (i) (rgb-new (modulo (* i 30) 256) (modulo (* i 50) 256) (modulo (* i 70) 256))) (iota steps)))) (define colors1 (blendy-list RGB-RED RGB-BLUE numpoints1)) (define points1 (map drawing-shift (map drawing-scale (map drawing-recolor (make-list 32 drawing-unit-circle) colors1) diameters1) hshifts1 vshifts1)) (define newpoints1 (map drawing-shift (map drawing-scale (map drawing-recolor (make-list 32 drawing-unit-circle) (blendy-list RGB-RED RGB-BLUE numpoints1)) (map (o (l-s * 3) increment (r-s mod 5)) (iota numpoints1))) (map (l-s * 10) (iota numpoints1)) (map (o (l-s + 100) (l-s * 100) sin (r-s / 3)) (iota numpoints1)))) (define newpoints2 (map drawing-shift (map drawing-scale (map drawing-recolor (make-list 32 drawing-unit-circle) (blendy-list RGB-RED RGB-BLUE numpoints1)) (map (o (l-s * 3) increment (r-s mod 7)) (iota numpoints1))) (map (l-s * 10) (iota numpoints1)) (map (o (l-s + 120) (l-s * 80) sin (r-s / 4)) (iota numpoints1)))) (define render-list-of-points (lambda (points) (image-show (drawing->image (drawing-compose points) 500 500)))) (define render-two-list-of-points (lambda (foo1 foo2) (image-show (drawing->image (drawing-group (drawing-compose foo1) (drawing-compose foo2)) 500 500))))