Sunday, 16 February 2014

Week 5

Once again sorry for my late post! I've been busy working away on my TOAH model and the solution to the 4 stool problem-pretty much addicted to cheese at this point-but its now finally done!

For this weeks blog, I will be discussing to main things; a recap on recursion, as well as a look inside my own problem solving process for A1, which is due very soon. Firstly-recursion.

Recursion, at first seemed to me like a very similar concept to "loops" with for and while loops, doing something over and over again until a certain condition has been met, however after completing lab #4, and going through all the recursion exercises they gave, I finally completely understand this technique. In particular, solving the backwards writing exercise, really helped to solidify my understanding of the base case, and how recursion uses the base case, and then "minimizes" it a bit in unique ways, in order to properly go through the recursive procedure, and keep going until a certain condition has been met.

The other important project, that I was at hard with work this week, was A1. A1 without sounding too overly dramatic-was probably one of the toughest assignments I have had to do in university. Each step, tested my dexterity and ingenuity in python, and required me to know the topics covered in the assignment, like the back off my hand. By the end of the assignment, I finally understood recursion, and how to go "up and down" the recursion tree, how to construct the proper classes, and the right syntax to use in all these situations. One of the trickier parts of the assignment for me was, definitely my implementation of the ConsoleController. I initially had a lot of difficulty with this step, as I was unsure as how to call the proper methods, and use the right implementation of actually asking the player to input moves. After some thinking with my partner, we ended up deciding to let the player input moves, like a tuple- in order to select destination and origin stools for cheese-and raise an illegal move error whenever it was needed to do so.

For this weeks blog post, I would again like to highlight two other blog posts, that I found to be particularly compelling.

 Firstly, the most recent blog post by http://albertcalzarettocs.blogspot.ca/. In his post, Albert describes his difficulty with tracing the recursion tree up and down for the final step of A1-a problem me and partner faced as well. One piece of advice I could try to offer him, would be too always start with the base case (3 stools) and then see how to extend that case in the most simplistic way possible. That method worked for my partner and I, although it did take a inordinate amount of time to solve the problem in the send.

Secondly, I would like to highlight the most recent post by http://bounce14.wordpress.com/, where the author of the blog discusses the use of tracing recursion. This again relates both to the other post I commented on above, but also relates to A1. In his post, he describes his method to trace these functions, and suggests using a python visualizer in order to trace these steps-something I may start using in the future, to solidify my understanding of this topic.

That's all for now!
Thanks.


No comments:

Post a Comment