Saturday, 26 October 2013

Assignment 1 and Recursive Functions (Part 1)

Alright, let me just say that the moment I opened sneeze.rkt, I totally blanked out as none of the codes seemed to make any sense to me. However, the function contracts and check-expects have been incredibly helpful since they together give a very good indication of what the function does, what is the input, what is expected, etc. I'm going to follow this practice from now on and I think everyone should get into the habit of doing it as well, as they make reading the code much easier when you come back to it after a while.

The assignment overall wasn't hard. Professor Heap basically has done all the hard parts and we only needed to fill in some holes. Unfortunately when running the program some error appeared and seemed to stem from the original code provided to us. Debugging did not work it's magic, so I'm turning to Professor Heap for help. We'll see what the problem is.



On last thought, one of the things that really amazed me from the 2 weeks of lectures was the concept of recursion: basically a function that calls itself, creating a loop. It seemed such a simple idea and yet is so elegant and powerful. Examples shown in lecture had so few lines of codes yet could achieve such complicated tasks as predicting the folding patterns of a strip of paper after, say, 100 folds.

No comments:

Post a Comment