Sunday, 5 April 2015

Post 8

Looking back at my post on recursion, I now feel a lot more comfortable with more advanced minimax programs and recursion in general. I found actually that learning about trees really helped me visualize how recursion really worked. When performing algorithms even as simple as node count or leaf count, I was able to visualize the tree and mentally trace what was being returned in each of the methods. LinkedLists are still a little bit tricky for me even though they usually dont involve recursion. I think that the abstract nature of the wrapper class still makes it a little difficult to understand but I do feel like I am getting much better at them.

The new assignment was posted and it looks very challenging but enjoyable. Pruning seems to be the most challenging of the three methods. Memoization seems pretty straightforward; it simple involves creating a global variable and updating it as you return values in you recursion of the game. Myopia also seems pretty simple; instead only passing in game state, you also pass in the depth to which you wish to check the game. If the game is over before the depth is reached, return the games outcome and if the depth is reached before, simple return rough outcome. To check if the depth is reached, in your recursive call, return (state, depth -1) and include an elif after if game.over which checks if depth is zero and then returns rough outcome.




No comments:

Post a Comment