Sunday, March 15, 2015

Week #9 (Mar. 9 - 13)

Unfortunately, the strike couldn’t be averted. So, there goes all of the tutorials and labs this week. But what is good is that at least assignment 2 is over. My partner and I struggled on implementing minimax for a couple of days in the week and we haven’t been able to get it working until Wednesday night. The problem that we were stuck on was that we don’t know when exactly to multiply the score by -1.0 and what do to with that score when we got it. Thankfully, by the end of the night we were able to think it through. We were supposed to multiply the score we get back from the recursive code by -1.0 since the score we were calculating is the current player’s opponent’s score. After getting the score, we can just use the move that produce the highest score from the list of possible moves.

This week, we were introduced to linked list. A linked list has a front, a back and a size. The front of a linked list is the first item in a linked list. Similarly, the back is the last item of a linked list and the size is just the number of items in that linked list. Each linked list node has two attributes, a value and the next linked list node that it is referring to. If a linked list has a size greater than two, then it must have a value connected or linked to the current node. For example, a linked list; 1 -> 2 -> 3 -> 4 -> 5 -> | has a size of 5, the front of the list is 1 and the back of the list is 5. The next linked list node from the front is 2 and the next linked list node from the value 5 is None, which signifies the end of a linked list. We also discussed iterations through the values of the linked list and mutating its data. At first, it was quite confusing to me since there are so many things to keep track of while tracing the code, similar to recursion. But after completing this week’s lab exercises, I was able to get a better understanding of linked lists and looping and changing them.


In the end, I wish that the strike will end soon, because it is affecting a lot of my course, especially the language course that I am taking. Since the instructor of that course is part of the union, all classes are cancelled.

2 comments:

  1. I also got stuck, I had to admit that the prof's advice was really helpful as it made me understand that the only part which need the recursion was the score.

    ReplyDelete
  2. I also got stuck, I had to admit that the prof's advice was really helpful as it made me understand that the only part which need the recursion was the score.

    ReplyDelete