Week 5
The midterms are coming. I just started working on Assignment 1 this week. It is really hard to understand the assignment at first. So I spent time discussing with my partner to make things clear. Then it took us not long to finish the first four steps. It is really cool to see the console controller working. I played the game over and over again to double check and have some fun with it. However, I'm stuck on Step 5 now because the recursion involved is kind of complicated. Professor Heap gave us quite clear explanation on the recursion though. It is still challenging to imagine the simple recursion codes working on this complicated Tour of Hanoi model. Comparing to the easier recursion codes we've dealt with in the lab, this recursion assignment is much harder to trace. Besides the recursion, the most difficult part turns out to be how to deal with the "i" involved. We are still in the way of figuring it out.
We practiced a lot of recursions in this week's lab. Most problems of the lab were fine, but the optional ones were extremely challenging for me. We didn't manage to finish them in the lab so I might need to work on them later when I have time. This week we also talked about "scope" and unittest. The scope part is pretty straightforward. Python looks from local -> nonlocal -> global -> built-in. We looked into some code showing the results with different scopes. Python gives different outputs with assignments to a same variable under different scopes.
No comments:
Post a Comment