Saturday, 21 March 2015

week 10 impressions

Week 10 we talked a lot about the previous assignment due the other week, and ways to solve it. A very frustrating aspect was how Heap decided to go over deep copies. Normally I would have been grateful, but the timing of teaching us about deep copies was too late for us to use it. During assignment 2 I had to ask a friend who had already taken CSC148 for help since I couldn’t seem to tackle the Minimax function. He explained to me then what a deep copy is, and that it would help significantly with the assignment. At this point in time, Heap had not mentioned it at all. The assignments have been relatively vague in directions, and the help that he gives either comes a week before the assignment is due, or a week after it is due and it can be extremely frustrating.

Other than that, this week we also learned about assertions and how they can be used in maintaining code after being updated, which is usually added by code in the format:
Assert <condition> , <error_string>

Which is essentially saying if not condition, then raise the error string to avoid bugs that arise from updates.

Wednesday, 11 March 2015

week 9 impressions (week 10)

Week 9 consisted of a slightly new data type that was a tree, but that is able to insert and delete nodes inside of the already existing tree called a BST. The only feature that came off as especially unique was that when inserting another bit of data (numbers) it would add itself into the appropriate tree so that it would be in increasing order from left to right from the root of the base.


We also had our midterm II this week which was much harder than the first test which only dealt with classes. I had a lot of trouble dealing with linked lists since I wasn’t nearly as familiar as I thought it was with being able to navigate each through elements in a linked list so that may turn out pretty badly.

Monday, 9 March 2015

week 9


On top of the assignment, last week we started looking at our newest topic/ADT: Linked Lists. This is a type of list that has any number of topics inside of it, while also containing a reference to another list. This data type is sequential because of how to reach any point in the linked list, you have to go through each previous element. this can significantly increase the time it takes to find a single element within the ADT. That said, the layout for this data structure is very clear cut and is easy to change elements within the list.

While on the surface, the concept of a linked list is coming off as a lot easier than the code itself but its interesting. The concept of having a list reference another list resounds the use of having a Root or BTNode have another node as a child which creates a bit more complex structure than  a linked list.

week 8

Last week Heap introduced a new, a slightly altered version of a tree, known as a BTNode with a specific design of having the children having to have conditions that would determine if it were to the right or left of the root node.
I'm still trying to get a feel for working with trees, but the coding in the BTNode is very similar in design so it shouldn't be too hard to navigate.
Assignment 2 is due in a week and with that being said there is a lot of stress looking at and taking a stab at the assignment itself. Designing the Tippy game itself took a bit of thinking to figure out but I decided to make the grid for the into a list of numbers so a grid 3x3 would just be a list of [1,2,3,4,5,6,7,8,9] and changing the value of the gives numbers to either an x or an o when a player applies a move to the gamestate. Figuring out the algorithm for a winning condition was just a bit of computation, and a general formula in terms of the grid size can be used to find win conditions.