Functional Problem Solving (CSC 151 2016S) : EBoards

CSC151.02 2016S, Class 26: Recursion Basics, Continued


Overview

Preliminaries

Admin

Reminders

Upcoming Work:

Extra Credit

Academic / Artistic

Peer

Regular Peer

Misc

Far in the Future

No Extra Credit, But Still Good

Questions

How do we do a blue blend? (We want to do something similar on the exam, so I thought I should ask.)

Suppose we have an image of a specified width, and we want to know how far along, a point (x,y) is. What do we do? Divide by the width, or the width-1.

If you are p of the way along, and the blue component ranges from 0 to b, use p*b to compute the blue component.

(define horiz-blue-blend
  (lambda (width height initial final)
    (image-compute (lambda (x y)
                     (irgb 0 0 (+ initial
                                  (* (- final initial) (/ x (- width 1))))))
                   width
                   height)))

(define horiz-green-blend
  (lambda (width height initial final)
    (image-compute (lambda (x y)
                     (irgb 0 
                           (+ initial
                              (* (- final initial) (/ x (- width 1))))
                           0))
                   width
                   height)))

Works dark-to-light and light-to-dark.

For Problem 2, Can we use supplied code?

Yes

For problem 2, mine looks kinda like a cat, but not as good as yours.

As long as it makes reasonable sense, it's fine.

Sam used something like (let ([p1 (+ 1 (- (max d1 d2 d3 d4) d1))])

Can you really have a distance of 500?

No

About how many different tests should we plan on for problem 4?

A dozen or so distinct tests.

Do we have to document supplied procedures?

No. If I take off later, remind me that I said this.

Even though we've identified approximately 1,289,131 mistakes on the exam ...

Yes, I will take more corrections.

Lab