So in week 8 we again focused on recursion and its various flavours. I suppose it is a 'step up' from the trees that we were doing a little while ago. Anyways, the class was first introduced to linked lists and then later in the week binary trees/ binary search trees; the latter two being very similar. So far I don't see a need for any of these 'abstract data types' but I suppose there are performance enhancements rather than just using regular data types. Depending on how material these benefits were, I might consider just using a regular list as it is significantly less work but those sorts of technical aspects have not been discussed. Speaking of lists, we were also introduced to the __contains__ method in Python that allows you to overwrite what the 'in' keyword will do (not limited to lists), among other things. So far only a handful of these inherited methods have been revealed and I for one would like to know how else the Python keywords can be manipulated. Assignment 2 was also due this past week and I was fine with everything except for the MiniMax strategy. At first (essentially until 9:30pm on the due date) I was having significant problems with NoneType magically appearing everywhere. The problem turned out to be a combination of a few things: firstly, my game_state had a mutable type in it that was also set as a default value in the constructor. This didn't initially seem bad until I started debugging. What was happening was that MiniMax would use the game state and this mutable type to determine what its move should be, but the game state that MiniMax was modifying and testing on remained the exact same game state that my game_view would use. Essentially MiniMax would leave the state in complete disarray in order to determine its move, so when the game view attempted to use apply_move, there were no more possible moves left in the state, so None would always be returned. After hours of pain, suffering, and 2 different debuggers, I finally managed to fix the problem right before the deadline...
According to some in-class discussion assignment 3 is supposedly going to have something to do with chess. It is quite coincidental because I am actually in the midst of creating a chess game in Java on my spare time, however I assume assignment 3 will be text based (I can only imagine the pain of trying to play a text-based chess game). At this point I am still not 100% confident about my abilities with recursion but hopefully it will become more clear by the next test. Lastly as part of this 'impressions' post, i'm sure everyone is aware of the current strike action. Sure it is inconvenient for everyone, but the TAs can't just stand by like slaves to the university plus there really isn't any other action they can take that would send a big enough message. So although I am upset that the strike had to even happen in the first place, I can't necessarily blame the TAs. I think the university administration needs to get their act together if they want to retain the title of "Top university in Canada".
No comments:
Post a Comment