The semester comes to an end, and I have less and less time to write posts for this blog. Last week in CSC148 was not easy for me. Term test was quite fair, although I couldn't remember what the tree tracing was about. Besides, it was pretty uncomfortable to call Danny every time I had minor questions about the test content.
It was also quite inconvenient not to have labs for two weeks in a row, and although I try to catch up with the course, it is not easy. I am completely lost in lab#8 now. I am sure there is an easy way to write the code, but I have no idea, what I am supposed to do. Anyway, I really need to sleep now, maybe I'll have some really good ideas after this.
Tuesday, 17 March 2015
Tuesday, 10 March 2015
Week 8 impressions
Another week has passed by, and I need to write another post. This week in class we learned about linked list structures. As it was already noted in the lecture linked lists have a lot in common with trees. However, in difference to trees linked lists can only have one node on them. I think the idea of reference between the nodes of the list can be very useful and important. It helps to connect otherwise unrelated data structures and use them as a whole. But although linked lists seem simple at first, it soon became clear to me that working with them requires not only thinking about the concept, but also a big deal of drawing pictures. Drawing schemes really helps when you start to create the code, because otherwise it is pretty easy to get lost in nodes and lose track of what the code is doing. When working on the lab exercises I realized how tricky these lists can be. Putting cur_node instead of cur_node.value has screwed up my entire work and cost me a lot of time to find and correct. Besides, the alternation between cur_node and prev_node in one of the functions was not easy to understand without a picture, however, I managed to figure it out once I've done the drawing.
To conclude, I hope that with more practice I'll get better with writing methods and functions for the linked list structures. And of course I hope that my second midterm will be at least as good as the first one.
To conclude, I hope that with more practice I'll get better with writing methods and functions for the linked list structures. And of course I hope that my second midterm will be at least as good as the first one.
Monday, 2 March 2015
Week 7 and assignment impressions
As I have already written a post about object-oriented programming before the reading week, I will just share my impressions about the first week after the reading week. These days are quite busy for me, as I try to stay on top of all of my essays, assignments and midterms. However, I try my best to keep up with the course content and meet all the deadlines.
This week in class we mostly discussed our second assignment and binary trees. I feel pretty confident with binary trees, and I think that the discussion of assignment helped me to get some insight into what I was supposed to do. Nonetheless, some things remain quite unclear. For instance, I still cannot get what the rough_outcome method in the TippyGameState class is supposed to do. Looking at its alternative in the subtract square game state I came to a conclusion that it's supposed to evaluate the outcome of yet unfinished game. The mechanism of work is pretty straightforward for subtract square, but things got really weird when I started to design it for tippy. To begin with, the only ultimately winning condition for the player I could think of, was an almost completed tippy. Of course, it was not easy to make computer find such a tippy on the board, and many lines of ugly code were created for this purpose. Another thing is that I couldn't make up any ultimately losing conditions, except for the one in which opponent has already formed a tippy, which is weird, as in this case game will be over. However, when I started implementing code for the strategy, I realized that, maybe, I should have implemented this function using some method which would list all possible outcomes of the game, and then evaluate this list to find rough outcome at certain point. On the other hand, it would have linked rough_outcome to the minimax strategy pretty tightly.
Another idea I struggle with while working on assignment is minimax strategy itself. It took me an entire day to get a slight idea of what should be happening in that piece of code. And when I finally found a way to make computer list all possible outcomes of a single move, it returned me an insanely nested list with, literally, thousands of items. It wouldn't be that bad (list was expected to be long and nested, as there are many possible outcomes of the game), if there was at least one -1.0 result on that list. Unfortunately, I could only see 1.0 and 0.0. Still, I guess, I need to improve that function or test it with more examples. Hopefully, I will eventually make it work and suggest_move will finally return the best possible move.
To conclude, most of this week was dedicated to writing an assignment, and I have a lot of impressions about it. I hope that I will manage to complete and submit it on time. Yet, I am feeling pretty insecure about this work.
Subscribe to:
Posts (Atom)