However, when I tackle with the assignment1, I feel confused about which method should be used in which class. I can create all the subclasses and write all the methods for that class, but there was a hard time for me to build the general classes, especially when I build the gameview class. Luckily, my group members solve this problem and explain it to me carefully -- Since general classes should work for all kinds of games, so when designing the general class, in this case a general class works for subtract square, just think of that the method I am going to design will work for other games such as chess. Then some methods such as legal_moves will not only apply for subtract square but also chess. Therefore, the arguement needed will not just be numbers, and I should raise the 'NotImplementedError' for that. Finally, I understand that how 'general' my class will be and how the method in that class will be designed.
Friday, January 30, 2015
Week 4
After about a month of studying csc148, I find that this course is like a combination of csc165 and csc108. So far I have learned more about classes, and obtain the ability of implementing a classes and its subclasses. Since I have learned about class in csc108, I feel like it is an easy part for me in the beginning.
However, when I tackle with the assignment1, I feel confused about which method should be used in which class. I can create all the subclasses and write all the methods for that class, but there was a hard time for me to build the general classes, especially when I build the gameview class. Luckily, my group members solve this problem and explain it to me carefully -- Since general classes should work for all kinds of games, so when designing the general class, in this case a general class works for subtract square, just think of that the method I am going to design will work for other games such as chess. Then some methods such as legal_moves will not only apply for subtract square but also chess. Therefore, the arguement needed will not just be numbers, and I should raise the 'NotImplementedError' for that. Finally, I understand that how 'general' my class will be and how the method in that class will be designed.
However, when I tackle with the assignment1, I feel confused about which method should be used in which class. I can create all the subclasses and write all the methods for that class, but there was a hard time for me to build the general classes, especially when I build the gameview class. Luckily, my group members solve this problem and explain it to me carefully -- Since general classes should work for all kinds of games, so when designing the general class, in this case a general class works for subtract square, just think of that the method I am going to design will work for other games such as chess. Then some methods such as legal_moves will not only apply for subtract square but also chess. Therefore, the arguement needed will not just be numbers, and I should raise the 'NotImplementedError' for that. Finally, I understand that how 'general' my class will be and how the method in that class will be designed.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment