Functional Problem Solving (CSC 151 2014F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference: [Setup] [VM] [Errors] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Davis (2013F)] [Rebelsky (2014S)] [Weinman (2014F)]
Misc: [Submit Questions] - [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)]
No partners! Sit wherever you'd like.
Overview
On the exam, should we have *all* of our procedures check preconditions?
E.g., should str-rot13 check that str is a string containing only
capital letters, or should 'shift-up' check that its input is an integer
between 0 and 25, etc.?
str-rot13should check its preconditions. The problem 3 procedures need not check their preconditions. Problem 1 says to check preconditions. On the others, it's somewhat up to you.
Does the procedure in problem 7 do anything sensible? It just seems like
it has a lot of let expressions that define variables as the null list.
Yes, it does something sensible. The one
letexpression you see seems to be a named let.
Can I solve problem 3 using 65 as the collating sequence number for #\A?
No. You may not hard-code the 65. But that doesn't mean that you can't write concise and general code that will work equally well if the collating-sequence number for
\Ais 65, or 200, or 11, or whatever..You know that
(shift-down (char->integer #\A))has to be 0,(shift-down (char->integer #\B))has to be 1, and so on and so forth.You also know that the letters are in sequence. So the collating sequence number for
#\Bis one higher than the collating sequence number for#\A, the collating sequence number for#Cis one higher than the collating sequence number for#B, and so on and so forth.
Is #7 the only one that requires documentation?
Apparently.
(image-series n width height)
You can find these in examples/project.
ellipses.rkt - straightforward, but makes compelling images
image-select-ellipse! and then something elsefor-eachmandelbrot.rkt - Mandelbrot set
Questions and notes