Sunday, 5 April 2015

SLOG7: Impression of the week

With time going by, it gets closer and closer to the end of the semester. Simultaneously, knowledge, ideas and solutions in our minds getting more and more.

This week the main concentration of mine was on the new coming Assignment 3, which asks us to do more study of game strategy via writing a series of recursive functions. The general idea of them is to regard a game state as a tree with nodes as current game states and children as next possible game states with different next moves. You can even use a "grow" function to get all the possible potential conditions from a single original game state node.

I have to say that the "grow" function in A3 really changed my idea of recursion somehow. In the past I believe that any recursive function should have a return value since the next step of recursion would be based on the return value from last step. In other words, if one function is recursive, sentence like "return f(x)" should be contained in the body part. However, in fact, it is not necessarily true. The "grow" function just need be called again by every item in "children" parameter without a return value. And, as defined in its docstring, the "grow" function itself does not have a return value, but actually it could be fulfilled via recursion.

For A3 I find another student as a partner and one of my tasks is to finish the "grow" function. I really appreciate it since I got an opportunity to know more about recursion and could use it more effectively. Moreover, I convinced myself that the working process of computer code and logic design are never set curved in stone. They could fit any condition and requirement as long as used properly.

Though the writing work is not done yet, I believe that we could get a high mark for this assignment with tough studying.

No comments:

Post a Comment