Functional Problem Solving (CSC 151 2016S) : EBoards

CSC151.02 2016S, Class 46: Analyzing Procedures


Overview

Preliminaries

Admin

Reminders

Upcoming Work:

Extra Credit

Academic / Artistic

Peer

Regular Peer

Misc

Not for Extra Credit

Questions

Should we write separate helper procedures on the project?

Please! It makes it easier for me to read. It makes it easier for you to experiment.

How upset will you be if we write a cond with 999 different options?

I'll be sad rather than mad.

How can I break an integer into a list?

One somewhat silly way

    (map (r-s - (char->integer #\0)) (map char->integer (string->list (number->string num))))

But math is your friend

    (list (quotient num 100) (quotient (remainder num 100) 10) (remainder num 10))

What if I want all sorts of numbers?

    (list (remainder num 5) (remainder num 7) (remainder num 11)
          (remainder num 13))

Lab

The lab makes much more sense if you've done the reading.

For list-reverse-2, make sure that you count calls to the kernel proc.

Remember! When you are counting calls to cons and company, you'll need to count the calls within append.

Writeup: