Sunday, February 16, 2014

Towers of Cheeses


        This week, I spent a lot of time on Assignment even if I have been worked on it for two weeks.  The Assignment one is the most complicated one that I have ever faced. Compared to the assignment I have worked in last semester, this one is much more difficult that the combination of the all. 
        Luckily, I have two great partners, who are known on piazza. Although we faced many times of barriers, we solved the each by looking discussing board and try lots of codes together. Everyone has his specialty, so all of us are pivots for the assignment. We enjoy this time and we decide to do the Assignment two together.
        The A1’s handout is clear and guides us on the right truck. We could always know how much percent we have done through the whole. TOAHModel is the first part in A1 and occupied the most of marks, but I really think Tour is the most difficult part. For TOAHModel, we quickly decided to make the stack as a dictionary, so the cheeses would be stored to the stools that are keys here. Then, we write the methods we need. However, it is not that easy to finish this part. Sometime we are confused whether the method is need or not, move. First, I support to write the move method in the ConsoleController, but I change my mind after arguing with my partners. We write the function in TOAHModel and just call it in the ConsoleController. The rest part of ConsoleController is much easier and funny. We try to make us game looks modern and we love playing our game. Furthermore, we play the tower game with different number of cheeses in order to find the rule of how the minimum moves happened. To be honest, there is no exaggerated that we try the game more than hundred times. Nonetheless, I enjoy it. 

Friday, February 7, 2014

Recursion


         I have learned about recursion for weeks as long as increasing the complexity. When I realize that I still feel difficult with doing lab this week, I know I need to pay more attention on it. There are steps for me to learn.
        What is recursion? Recursion means, “defining something in terms of itself”, which is that generally functions can call themselves.
        I read the reading about drawing fractals, which is similarly with the example shown in class. Then I learn the recursion deeper through the order in the reading posted by instructor: recursive date structures, processing recursive number lists, case study.
        Honestly, I am attracted in recursion now due to animated fractal, using PyGame. There are many beautiful graph made by using recursion, like kinds of tree and snowflake.
         

Thursday, January 30, 2014

Raising and Catching Exceptions


         During the lab of this week, my partner and I both feel the difficulty of problems in the handout. Firstly, we are confused about the difference between attributes and method.  After the clarification of TA, we are eventually on the right track, but a little behind of other classmates.  At that time, I realized that I do not have a good way for studying CSC148. We have pre-videos in CSC108; thus, it is good for me to know what I will learn in the following week and the videos clearly show the main contents of the course. I never look at outside sources in the last semester. Nevertheless, I am pretty sure that I need to change my study way. Although the professor posts the related information, which is about the learning points we need to know, I still do not pay much attention on them. Now, I realize that I need to seriously read them.
         Before I take a look reading and review the python examples, I even do not understand the handout of exercise this week and do not know how to start the code. Moreover, I search everything confused in the handout such as exception class. Therefor, I read the reading according to Exceptions. I know what is exception and when it is happened. Even if the code has no syntax error, it may cause different types of error when an attempt is made for executing it. Furthermore, I learn how to catch exceptions by using try-except statement and raising our own exception. Actually, this part is not that such difficult. I finish the exercise in a few minutes and pass all the tests. Luckily, it seems that I find a suited way of learning for myself.

Tuesday, January 21, 2014

Object-Oriented Programming

       Python, even other programming languages,  is new for me until last semester. Throughout the learning in CSC108 and the studying in the first three weeks of CSC148, I know that Python is an object-oriented programming. Everything in program is an object and has their type. I learn some basic classes such as int and str, and I also learn how to define my own classes. For Python, the main task is for creating objects, which are the instances of classes, and writing functions. All in all, the most important part in object-oriented programming are objects, which can store the data and working with module. To be honest, finding the bugs is still a difficulty for me and I am not familiar with using methods. Nevertheless, I will keep working and deal with the confusions in a short time.