Functional Problem Solving (CSC 151 2015S) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Taking Notes] [Rubric] - [Calendar]
Current: [Assignment] [EBoard am] [EBoard pm] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards am] [EBoards pm] [Labs] [Outlines] [Readings] - [Examples] [Handouts]
Reference: [Setup] [VM] [Errors] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Davis (2013F)] [Rebelsky (2014F)] [Weinman (2014F)]
Misc: [Submit Questions] - [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Book Office Hours] - [Issue Tracker (Course)]
Overview
irgb-brightest?Can you help me think about the tests in problem 6?
You will need to write tests that use particular colors, colors which you will normally create with
irgb.Your main check is "Did
irgb-classifyclassify it correctly?"For example
(check-equal? (irgb-classify (irgb 200 201 200))
'greenish
"large, close, values; red=blue; green dominates")
I'm getting a weird "quark" error in problem 8. Can you tell me why
You are probably generating a y value outside of the valid range. Try generating the list of y values and scanning it for negative numbers or values greater than height-1.
Computers are sentient and malicious.
How long is "long" for lists when we are checking rdc and rac?
10,000 or so would be good to test.
irgb-brightest?(define irgb-brightest
(lambda (colors)
(cond
[(null? (cdr colors))
(car colors)]
[(>= (irgb-brightness (car colors))
(irgb-brightness (irgb-brightest (cdr colors))))
(car colors)]
[else
(irgb-brightest (cdr colors))])))
The pattern you choose is important!
Please do NOT use the following form
(define largest
(lambda (lst)
(cond
[(null? (cdr lst))
(car lst)]
[(max (car lst) (largest (cdr lst)))])))
else before your defaultSo write
(define largest
(lambda (lst)
(if (null? (cdr lst))
(car lst)
(max (car lst) (largest (cdr lst))))))
Pun of the day
irgb-all-bright? you can write irgb-madeleine?