Functional Problem Solving (CSC 151 2015F) : EBoards

CSC151.01 2015F, Class 35: Mechanisms for Repetition


Overview

Preliminaries

Admin

Upcoming Work

Extra Credit Opportunities

Academic

Peer Support

Regular Peer Support

Upcoming Peer Support

Other Good Stuff to Do

Questions

Do you have any observations after helping people with Part C?

Remember that when you decide to split the region, you have to recurse twice - either for the left half and right half, or for the top half and bottom half.

Remember that left, top, width, and height all have to be integers. In some cases, you won't be able to divide exactly.

What angle did you use for the swirly one?

I think I used (/ pi 32)..

The original "painting" was made by selecting left:100, top: 50, width: 200, height:260.

When replacing, I used left: 110, top: 60, width: 180, height: 240, which I think preserved the aspect ratio of the image.

Contrasting map, for-each, repeat, and recursion

map:

for-each:

repeat:

recursion:

If you go from a list to a list of the same length: map

If you do things mostly for side effects: for-each or repeat

General case: recursion

Lab