Computer Science

Computer Science

Sunday, February 2, 2014

Intro to recursion, assignment 1 - Week 4



This week in lecture, we covered recursion by going through some examples. One of them was figuring out the "maximum depth" of a nested list. The other was drawing a fractal tree using Turtle. In both cases, I was able to trace the code presented, but I am still not satisfied. I don't feel like I fully understand recursion yet. I would have a hard time coming up with recursive algorithms on my own, so I feel like I need to practice writing recursive programs on my own.

On Thursday, I spent the entire day working on assignment 1. I managed to complete parts 1-4 which I am very happy about. I am able to manually use the GUIController to move the cheeses, and I'm also able to use ConsoleController to play the game. All that remains is figuring out an algorithm for the four stools problem, and implementing it in Tour.py. I am fairly confident that all the code I have wrote so far is "good" code. I did docstrings and examples which work as well, so I feel good about this assignment so far.

Truthfully, when I first read the assignment handout I kind of freaked out because there was so much starter code and information. It seemed overwhelming, but I tackled the problem one step at a time. Before I even started writing code, I made notes and tried to figure out what to do before doing anything. I think this was a good strategy, as it allowed me to complete TOAHModel.py in just one day.

No comments:

Post a Comment