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
section. For others, it will be intuitive. We will spend
a few weeks trying to make it intuitive for everyone.When I'm picking the random column and row, what range should I choose from?
For the column, it should be a number between left and left+width-1.
But random only gives me a value between 0 and n-1.
Think about how to transform one range to another. (Hint: Addition.)
Do I need to document the procedures in part 3?
Yes. But you can use just 4P's.
No Lab Writeup Today!
Lesson 1: You can only take the car of non-empty lists and things created
with cons.
Lesson 2: You can only use up to four middle letters in the silly cddddr
procedures.
Lesson 3: Computer scientists often start numbering at 0, rather than 1. That's somewhat nice for how we write procedurees, since to get element 5 of a list, we have to call cdr 5 times.
Lesson 4: Scheme lets you create things that aren't lists. These things show up with a dot in the middle. Be careful when you have such things; they will sometimes, but not always, lead to errors when you use them like lists.
> (cons 1 (cons 2 3))
> (append (iota 50) 1)
Lesson 5: car and cdr work with the "not quite list" things. They
are officially defined with the rules
(car (cons a b)) = a
(cdr (cons a b)) = b
Note 6: For problem 5, consider
(cons 'drawing (cons 'rectangle (cddr drawing)))