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
Three important lessons from today's lab ....
The (define ...) tab is really useful.
If you write
(define bound
(lambda (val lower upper)
(min (max val lower) upper)))
and then call
(bound 5 0 10)
DrRacket substitutes 5 for val, 0 for lower, and 10 for upper, giving
(min (max 0 5) 10)
Which it then computes.
Indentation can improve readability
(define rgswap (lambda (color) (irgb (irgb-green color) (irgb-red color) (irgb-blue color))))
(define rgswap
(lambda (color)
(irgb (irgb-green color)
(irgb-red color)
(irgb-blue color))))
Zachary says "Save early and often."
Sarah says "Mark where you are in the lab."