Functional Problem Solving (CSC 151 2016S) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Taking Notes] [Rubric]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Labs] [Outlines] [Readings] - [Examples] [Handouts]
Reference: [Setup] [Remote] [VM] [Errors] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Curtsinger (2016S)] [Davis (2013F)] [Rebelsky (2015F)] [Weinman (2014F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)]
Overview
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.