Sunday, 23 February 2014
Week 7 - Nothing to report
Reading week. Have a test and assignment coming up, but that can wait. All quiet on the western front. Got an interesting question from a younger friend regarding breadth-first searching though. Searching it up, it seems rather pointless. Will need to investigate further.
Saturday, 15 February 2014
Week 6 (apparently)
The topic once again falls back to recursion. More specifically, Assignment 1. After experimenting with a few different ways to solve the Tower of Hanoi with four stools in the fewest moves possible (with varying levels of success), I managed to find, with great difficulty, the minimal number of moves and the optimal split value i recursively. Unfortunately however, in this configuration, I was not able to actually move the cheeses in any stacks totalling more than ten blocks without attempting an illegal move, something I was able to accomplish with more basic splitting methods. It certainly did not help that my computer decided to die on the due date, but fortunately I had already submitted the files beforehand. And people wonder why I hate computers....
Monday, 10 February 2014
Week 5 - A bit late
As mentioned, this update is slightly behind schedule thanks to a preoccupation with the Tour of HanoiAnne Hoy assignment. While not complete yet, this assignment has been the object of particular annoyance for the past week or more, and I have not yet even worked on the recursion part, which will probably actually be easier, interestingly. One positive product of this however is that I finally decided to make use of doctest, and to good effect. On the other hand, I really wish instructors gave better descriptions on how to use code that's provided. I spent about an hour messing around with the GUIController and trying to debug my own code, not realizing that I was supposed to click on the "stool" rather than the space above it in the interface.
Sunday, 2 February 2014
Week 4
Recursion is the hot topic this week, but for the large part, that's a topic for another time. I already know the basics from beforehand, and I would say it is fair to say that recursion is surprisingly easier to understand than it is to explain without the use of aids.
So, without further delay, rather sure than talk about recursion, I will talk about errors and exceptions. The basic concept is rather simple, plan ahead for errors that might occur, and deal with them. That said, it took me quite a while to figure out what Exercise 2 meant when it said to raise an exception implicitly, even though, as it turned out, I had done it that way all along. Using unittest to check if an exception is properly raised was also an annoyance during the lab, thanks to the not entirely intuitive way that assertRaises works, and the Library not being entirely clear on that.
So, without further delay, rather sure than talk about recursion, I will talk about errors and exceptions. The basic concept is rather simple, plan ahead for errors that might occur, and deal with them. That said, it took me quite a while to figure out what Exercise 2 meant when it said to raise an exception implicitly, even though, as it turned out, I had done it that way all along. Using unittest to check if an exception is properly raised was also an annoyance during the lab, thanks to the not entirely intuitive way that assertRaises works, and the Library not being entirely clear on that.
Subscribe to:
Posts (Atom)