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
Image-making techniques
image-variant, `image-transform!
(image-redo! image (lambda (col row color) ...)image-transform! and image-redo! behave differently with
selections.image-computeI've added a variety of project tips that I thought we'd look at quickly.
You can also find a few others on the tips page, such as a procedure to copy and paste.
assoc - finds an element of a list of lists by comparing a sought
value to the car of each of those lists.We try to write algorithms that are fast in terms of the size of the input
Why color-name->irgb is slow
(define color-name->irgb
(let ([named-colors
(list (list "black" (irgb 0 0 0))
(list "white" (irgb 255 255 255))
(list "green" (irgb 128 0 0))
(list "wheat" (irgb 245 222 179))
(list "sarah" (irgb 240 0 230))))
(lambda (name)
(let ([result (assoc name named-colors)])
(if result
result
(error "Not a valid colir name: " name))))))