As this course comes to an end, it's pretty crazy to think of all the things I've learned in such a short period of time. It didn't feel like I learned that much but as I look back, this introduction to computer science course was quite eventful. I dabbled in basic A.I. for the first time, I learned much about stacks, queues, linked lists, ADTs, classes, trees, binary trees and especially recursion. This course was difficult at times, but definitely very rewarding.
I liked many things about this course and although we had a minor setback with the TA strike, I felt it was very successful. I liked the freedom we had in our assignments, I thoroughly enjoyed having Danny as a professor for a second time and I really liked the material.
Thanks for reading these throughout the semester, wish me luck on my exams!
J.M
CSC148 Slog
Friday, April 3, 2015
Sunday, March 15, 2015
Linked List
Dear Blog,
Lately in CSC148, we have been learning about linked lists. We also just wrote the second mid term. I think the term test went pretty well. There was one question on the test that involved linked lists. I found the linked list material quite easy to grasp.
Linked lists are pretty interesting. It consists of black boxes that all point to another black box, and this is how they are all linked together. It is like a train of nodes. They are similar to trees in a way, but also very different. To go visit a specific node in a linked list, it seems that you have to start at the front and iterate through the entire linked list.
I don't know TOO much about linked lists yet. I still don't see the advantage to using them over regular lists, but I feel that when we start including recursion into linked lists, I will see the point. Here is a picture to illustrate the difference between a regular list and a linked list.
I will keep you updated on linked lists and everything else going on in this class.
Thanks,
J.M.
Lately in CSC148, we have been learning about linked lists. We also just wrote the second mid term. I think the term test went pretty well. There was one question on the test that involved linked lists. I found the linked list material quite easy to grasp.
Linked lists are pretty interesting. It consists of black boxes that all point to another black box, and this is how they are all linked together. It is like a train of nodes. They are similar to trees in a way, but also very different. To go visit a specific node in a linked list, it seems that you have to start at the front and iterate through the entire linked list.
I don't know TOO much about linked lists yet. I still don't see the advantage to using them over regular lists, but I feel that when we start including recursion into linked lists, I will see the point. Here is a picture to illustrate the difference between a regular list and a linked list.
I will keep you updated on linked lists and everything else going on in this class.
Thanks,
J.M.
Saturday, March 7, 2015
Assignment and Term Test #2
This week, my main focus was the second assignment, which was handing in two days ago, and it's now time to focus really hard on the second term test. My group and I thought the assignment would be really small and simple. We were right about one thing, it was small, but definitely not simple. We must have worked solely on the minimax strategy for roughly six hours. It was tough to wrap out heads around minimax strategy, but eventually we got it (I hope). After all that intense work, it turned out to be a measly 20 or so lines long.
Another focus this week is the 2nd term test. I am not too worried about the term test, even though it has been a bit of a confusing time, with the T.A. strike and not having labs. I have tried to work on the lab exercises by myself and with some friends, and after doing those and reviewing previous term tests, I am feeling pretty good about this term test. I think I will do pretty well!
Another focus this week is the 2nd term test. I am not too worried about the term test, even though it has been a bit of a confusing time, with the T.A. strike and not having labs. I have tried to work on the lab exercises by myself and with some friends, and after doing those and reviewing previous term tests, I am feeling pretty good about this term test. I think I will do pretty well!
Sunday, March 1, 2015
Binary Trees
The slog entry I am choosing to be marked is titled "Object-Oriented Programming (OOP)"
This week, we focused on binary trees. I didn't have too much of a problem with recursion originally, but learning the recursive solution to binary tree problems is something I find quite difficult.
Something important about binary trees is that each "node" can only have at maximum two children. A node is any connecting point of the tree.
Dear Blog,
This week, we focused on binary trees. I didn't have too much of a problem with recursion originally, but learning the recursive solution to binary tree problems is something I find quite difficult.
Something important about binary trees is that each "node" can only have at maximum two children. A node is any connecting point of the tree.
Above is an example of a basic binary tree.
There are also binary search trees which we just started learning about. The idea is that every left side of the node is lower and the right side is greater. This makes is easier to sort or search trees because it is much more efficient to ignore the parts we don't want or need. Here is an example of a binary search tree.
Notice how the left side of the node is lesser and the right side is greater.
Thanks for reading this week's post!
Sincerely,
Sincerely,
J.M.
Sunday, February 15, 2015
Object-Oriented Programming (OOP)
Dear Blog,
Welcome to my first impression of Object Oriented Programming. OOP focuses on objects and methods rather than functions. It looks a lot cleaner and is much easier to read in my opinion. So far, I like object oriented programming.
I think OOP will be very useful in the world of game design. Take our assignments for example: I like that we have created general classes with sub-classes that are specific to different games. I thin OOP is a really useful, and tidy way of programming to successfully access your code and change code without messing everything up.
I agree with the write of this blog http://kurtvcsc165.blogspot.ca/ because one thing I found interesting about OOP in python is the naming of methods in classes. Private and public functions are not new to me but I found it strange that anyone could actually access your private function but putting an underscore before is just a polite way of saying "please don't touch".
I look forward to talking about my next week of class, but for now I'm on reading week. Woo-hoo!
Thanks,
J.M.
Welcome to my first impression of Object Oriented Programming. OOP focuses on objects and methods rather than functions. It looks a lot cleaner and is much easier to read in my opinion. So far, I like object oriented programming.
I think OOP will be very useful in the world of game design. Take our assignments for example: I like that we have created general classes with sub-classes that are specific to different games. I thin OOP is a really useful, and tidy way of programming to successfully access your code and change code without messing everything up.
I agree with the write of this blog http://kurtvcsc165.blogspot.ca/ because one thing I found interesting about OOP in python is the naming of methods in classes. Private and public functions are not new to me but I found it strange that anyone could actually access your private function but putting an underscore before is just a polite way of saying "please don't touch".
I look forward to talking about my next week of class, but for now I'm on reading week. Woo-hoo!
Thanks,
J.M.
Sunday, February 8, 2015
Tracing Recursion
This week I have to write my impressions on tracing recursion from week 4. I found tracing recursion quite simple and straightforward. When tracing recursive functions, I think it is important to start by identifying the base case because that is most likely the easiest case. Then, I would identify the general case. The thing about the general case is, you have to think about it in terms of the base case because after tracing the general case, it will eventually lead you back to the base case.
For example:
That is basically all I have to say about tracing recursion. We also wrote the first midterm of the year for this class this week. I thought it went pretty well. It was pretty much what I expected, decently difficult questions that reflect what you have encountered in lecture and in labs.
Thanks,
J.M.
For example:
def count_elements(L):
’’’(list or non-list) -> int
Return 1 if L is a non-list, or number of non-list elements in
possibly-nested list L.
Assume: L is any Python object.
# examples omitted!
’’
if isinstance(L, list):
return sum([count_elements(x) for x in L])
else: # if L is not a list, count it
return 1
In this example, return 1 when the input is not a list is the base case. The general case is return the sum of the list after it has been passed by count_elements. The general case passes the list into count_elements into there are not more lists within the list. When this happens, we return a 1 using the base case.That is basically all I have to say about tracing recursion. We also wrote the first midterm of the year for this class this week. I thought it went pretty well. It was pretty much what I expected, decently difficult questions that reflect what you have encountered in lecture and in labs.
Thanks,
J.M.
Sunday, February 1, 2015
First Few Weeks
Dear Blog,
So far CSC148 has been much different than CSC108 but they share some similarities. This class definitely seems like it will be much more challenging. Throughout the first few weeks, we focused on classes, sub-classes, inheritance, exceptions and recursion.
I worked in a group of three for Assignment 1. The assignment was basically my first time dealing with A.I (granted, it was very simple A.I). The idea of the assignment was to create classes and sub-classes of those classes to create a text-based game that you could play against a computer. We had to create the game called "Subtract A Square", where each player subtracts a square number no larger than the current number. The last person to make a subtraction wins. This game involved 5 classes: a game state class, which keeps track of the current state of the game. The subtract square class, which is a sub-class of game state keeps track of the game state specific to subtract square. Then there is a strategy class, and a specific sub-class for strategy used for subtract a square, which just generates a random integer for the computer to choose (simple A.I). Then there is the game view class which keeps track of the game, who's turn it is, whether a move is legal and basically runs the game. The reason for all the inheritance and sub-classes is, for future assignments, we will be adding more specific games and having the general parent classes will make this much easier.
Since these topics, we have been learning recursion. This blog post was very interesting to read about recursion: https://nicoleslog.wordpress.com. The blogger raised some very good points about recursion. They asked three key questions:
So far CSC148 has been much different than CSC108 but they share some similarities. This class definitely seems like it will be much more challenging. Throughout the first few weeks, we focused on classes, sub-classes, inheritance, exceptions and recursion.
I worked in a group of three for Assignment 1. The assignment was basically my first time dealing with A.I (granted, it was very simple A.I). The idea of the assignment was to create classes and sub-classes of those classes to create a text-based game that you could play against a computer. We had to create the game called "Subtract A Square", where each player subtracts a square number no larger than the current number. The last person to make a subtraction wins. This game involved 5 classes: a game state class, which keeps track of the current state of the game. The subtract square class, which is a sub-class of game state keeps track of the game state specific to subtract square. Then there is a strategy class, and a specific sub-class for strategy used for subtract a square, which just generates a random integer for the computer to choose (simple A.I). Then there is the game view class which keeps track of the game, who's turn it is, whether a move is legal and basically runs the game. The reason for all the inheritance and sub-classes is, for future assignments, we will be adding more specific games and having the general parent classes will make this much easier.
Since these topics, we have been learning recursion. This blog post was very interesting to read about recursion: https://nicoleslog.wordpress.com. The blogger raised some very good points about recursion. They asked three key questions:
- What is needed in recursion?
- How does recursion work?
- What are the benefits of recursion?
I am going to think more about these questions and return next week with more information on recursion. Wish me luck on Wednesday's midterm!
Subscribe to:
Posts (Atom)


