Wednesday, February 5, 2014

Week 5: Hanoi Recursion and Scope


This week we went through a 3 stool recursive Tower of Hanoi solution, as well as going over scope. The Hanoi algorithm we went through really helped me understand the problem and I started working on a 4 stool recursive solution, which works somewhat so far, but getting it to work properly is proving to be fairly difficult. It also reminded me of that scene in Rise of Planet of the Apes when that ape was solving the problem. I think Danny was right when he said that the last 10% of the problem takes 90% of the the work; I'm done basically everything else for the first assignment. I feel fairly confident after another recursive example and the lab we did this week.

As my lab partner CrustyBlogger notes, the labs in this class are significantly more difficult than the ones in CSC108. The labs do help me learn the material and our lab partnership is an efficient one, and this week with the addition of Infernvs to our group, we were elevated to the status of dream team. Infernvs notes in his SLOG that the concept of OOP is a “trivially simple concept to explain”, which I agree with. His analysis of the Sierpinski triangle was pretty intense and went way over my head. I found I understood the scope concept fairly well because I have come across this idea before while learning Java. The prefix global allows a variable/function to be accessed throughout the class/file and nonlocal allows for access exclusively in the module (function). I already see the potential uses of this and I may implement it into my A1 code.

                         Hanoi is so simple an ape can solve it.               (http://static1.wikia.nocookie.net/__cb20120530021256/planetoftheapes/images/6/61/Bright_Eyes_2.jpg)
 




No comments:

Post a Comment