Today’s start-of-class procedure
Warning! You are being recorded and transcribed, provided the technology is working correctly.
Approximate optimistic overview
image-load
and image-save
in
the definitions pane.Scholarly
Artistic
Multicultural
Peer
Musical, theatric, sporting, and academic events involving this section’s students are welcome.
Wellness
Misc
These do not earn tokens, but are worth your consideration.
Example one: A student comment from mini-project 2.
For the pentagon, I did get a little bit of help from the programming assitant chatgpt, I was having trouble with knowing how to incorporate real-part, imag-part, and tying it all together.
Example two: Some code from mini-project 2
(build-list sides (lambda (i) (make-point side-length (general-radius sides) (general-theta sides) (+ 2 i))))))
build-list
. So the student found it on the
Interweb. (Hopefully not with ChatGPT.)Example three: Strange file uploaded
There are many goals and processes for decomposition. Not only are we breaking a big problem into smaller parts, we are also trying to avoid repeating ourselves.
In many cases, I saw that you did some decomposition well, but left some repeated code. My initial inclination was to mark all of those as “Redo”. After some reflection, I decided that talking about it in class would suffice. If there’s more than one case of repetition, you have a redo. If there’s only one, you have an S.
On to the problem itself …
Sam, how do I reduce redundancy in my compute-pentagon-point
procedure?
(define compute-pentagon-point
(lambda (radius num)
(pt (real-part (make-polar radius (* 2/5 num pi)))
(imag-part (make-polar radius (* 2/5 num pi))))))
(define that-point
(lambda (radius num)
(make-polar radius (* 2/5 num pi))))
(define compute-pentagon-point
(lambda (radius num)
(pt (real-part (that-point radius num))
(imag-part (that-point radius num)))))
Another solution
(define polar->point
(lambda (polar)
(pt (real-part polar)
(imag-part polar))))
(define compute-pentagon-point
(lambda (radius num)
(polar->point (make-polar radius (* 2/5 num pi)))))
A solution that I’d prefer you not use (yet).
(define compute-pentagon-point
(lambda (radius num)
(define polar (make-polar radius (* 2/5 num pi)))
(pt (real-part polar)
(imag-part polar))))
Sam doesn’t like this last version because
define
within define
, which is known to cause weird behavior.Lessons:
Do I have to tell you when I’m spending a token to turn something in late?
No.
I got an I on MP1. Will you charge me tokens for redoing MP1?
No.
I got an I on MP2. Will you charge me tokens for redoing MP2?
Yes. Tokens are my way of encouraging you to make sure you make an appropriate start on mini-projects.
When do we make up quizzes?
Option 1: During the next quiz day, there will (usually) be make-ups for past quizzes. (They aren’t identical.)
Option 2: On the SoLA (take-home exams).
Can you tell us more about take-home exams?
Yes, when I distribute them. But not today.
Is it okay that I learned things from the Racket Web site and cited them?
Yes.
When redoing a mini-project do I have to start over?
Generally, no. Just fix the parts that we tell you need fixing.
What should documentation look like?
;;; (PROCEDURE PARAMS) -> type?
;;; PARAM : type?
;;; PARAM : type?
;;; PARAM : type?
;;; SHORT DESCRIPTION OF WHAT THE PROCEDURE DOES.
;;; (compute-pentagon-point side num) -> point?
;;; side : positive-real?
;;; num : integer? (in the range 1 .. 4)
;;; Compute one point on a pentagon, numbering them clockwise.
If I used one semicolon rather than three, do I need to resubmit.
Nah.
Cool?
Of course. It’s winter in Iowa.
Same partners, new submission