Functional Problem Solving (CSC 151 2015F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Taking Notes] [Rubric] [Remote Access]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Labs] [Outlines] [Readings] - [Examples] [Handouts]
Reference: [Setup] [VM] [Errors] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Curtsinger (2015F)] [Davis (2013F)] [Rebelsky (2015S)] [Weinman (2014F)]
Misc: [Submit Questions] - [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)]
Overview
Will you be upset if my lines of Scheme are more than 80 characters and therefore wrap into unreadable form?
Yes.
I'm still getting the annoying GDBus error. What should I do?
I've found that most of the instances have to do with
image-get-pixel. I've been using the following strategy.First, add the following to the definitions pane.
(define image-get-pixel-verbose
(lambda (image col row)
(display (list 'image-get-pixel image col row))
(newline)
(image-get-pixel image col row)))
Next, change the calls to
image-get-pixelto useimage-get-pixel-verbose.Finally, look at where you're trying to get pixels form.
My code for problem 3 has a lot of calls to make-list. Do you think
that's a good idea?
Probably not. Think about the following pair of expressions. The second is more efficient (and probably clearer).
(map list (make-list 10 0) (iota 10))
(map (section list 0 <>) (iota 10))
Should we write at least the 4P's for our helper functions?
Yes. Particularly if you name them things like "ell" or "ipse" or "fun", "ellipse1", "ellipse2"
For 3b, can we assume that top and height are reasonable?
Yes. I probably should have made you write preconditions, but I said "Do not document".
Can I still document when you say "Do not document"?
Yes.
What should our tests and examples look like if it outputs an image?
; > (image-show (image-target! "red" "green" "blue" "purple" 25 17 83 11 200 800))
; 5
; ; Image 5 shows me ...
substring!(substring a b) go to position b-1? (substring a b) and (substring b c),
and don't want them to overlap.Solution for 6a
(define string-sum
(lambda (str)
(sum (map char->integer (string->list str)))))
Alternate solution for 6a
(define string-sum
(o sum (section map char->integer <>) string->list))