Sunday, March 29, 2015

Impressions of Week 8

    In this week, we had some very exciting things going on, such as the heart-pounding race to finish assignment 2 before 10:00 pm on Thursday and an unguided session of wracking our brains over lab #7. While it does feel nice to not go to labs, it's starting to take its toll. This class is starting to feel more and more like my high school programming class which went something like this: "Here's your assignment, now go teach yourself how to code!" Not that I had a problem with this in high school, but perhaps CSC148 material isn't that easy to figure out on your own. 

    Assignment 2 was pretty straightforward in terms of making the Tippy game, and so far it's the closest we've come to actually making graphics for a game, if you can call the grid made out of text 'graphics.' My grids looked something like this:

  0  1  2  3  
0 /  /  /  /  
1 /  /  x  /  
2 o  o  o  /  
3 /  /  /  x  


    I'd say my greatest accomplishment was to add numbers to indicate columns and rows, so the player doesn't have to count for himself like some sort of peasant. 

    As for the Minimax strategy, I'm pretty sure it works but I don't remember how I completed it or how it works, that memory is suppressed until I'll probably need it in assignment 3. 

Mandatory Acknowledgement of Other Slogs

http://initializationcomplete.blogspot.ca/
When I first looked at this SLOG, I was blown away. The style of writing, the comprehensive understanding this student displays of CSC148 content, it's almost perfect! The only possible flaw I could find here is that there isn't a single post, but surely that's only a small imperfection. 

http://thecstists.blogspot.ca/
One of the great things about this SLOG is that this student actually talked about linked lists, unlike me, because I only talked about A2 in my week 8 post. Even better is that this student actually walks us through their learning process, starting with a concept they had difficulty understanding, and outlining how they figured out the problem. For example, they talked about how they couldn't quite comprehend how the 'append' method is implemented in a linked list, and goes through the steps of how they finally understood it.

Sunday, March 15, 2015

Impressions of Week 7 + Other SLOGS

    In week 7, we learned about Binary Trees, and Binary Search Trees. This is actually a simple concept in itself. There is a node with data, and it references up to two other nodes: left and right. These referenced nodes could also contain left and right nodes, and those could also contain left and right nodes, and so on. Here is a representation of a binary tree, which as you can see starts with a root, and then branches out into left and right nodes.


    This tree is labeled 'Full Binary Tree' because each node actually references two other nodes, except for the leaves (nodes at the very end). A tree like this could also be a binary search tree, which would have to satisfy the following properties: the data contained in each node must be comparable (like integers), the data in the left node must be less than that of its root, and the data in the right node must be greater than its root. Now, the reason this is called a binary SEARCH tree is because this data structure can be searched more efficiently than a list. If you want to find all the numbers within a certain range on a binary search tree, you don't have to visit every node because a search algorithm would know not to visit nodes that will not contain the data its looking for.

And now for the mandatory acknowledgement of other SLOGS:

http://cslogcs148.blogspot.ca/
First off, this URL is very unimaginative. I can already tell just from the URL that this is going to be very dull yet informative...

...well it is informative, I'll give it that. However, this one part bothered me: "The computer is way smarter than a1 now, you can hardly beat it :D" (in reference to the minimax strategy we implemented in a2). What kind of n00b loses to a bot? You gotta step up your game.

http://joshpinkney-csc148.blogspot.ca/
Still a boring URL, but at least it's personalized with the author's name. I particularly like the examples he uses when talking about class inheritance:

>>> horse = horse("Jim", "Black")
>>> horse.noise()
"NEEEEIIIIIIGGGGHHHHHH"

>>> cow = cow("Bob", "White with Black spots")
>>> cow.noise()
"MOOOOOOOOOOOOOOOOOOOOO"

>>> piggy = pig("Timothy", "Pink")
>>> piggy.noise()
"OINK OINK"

I think that this might be the most useful program I have ever encountered, because I always seem to forget what noise a horse makes.