I took almost the whole weekend last week to finish Assignment1! But I felt
really accomplished when seeing the animation work! Completing part 1 and 2
wasn't too hard, because you just have to store instance variable to a class
and write methods header. Part 3 was a bit annoying because I need to first
understand what each method in DomainStools does in the ManuelController class,
then implementing it. The method 'add' and 'move' took me around 2 hours to finish. At first, I did not understand what ‘add’ does because DomainStools has nothing
to do with graphics of the cheese or the canvas. After a while, I realized it
is used for restricting which cheese you can move. For method 'move', I had
problem distinguishing the bottom cheese (stool) because they all have the same
size. Thus by just checking the size of the bottom cheese, I cannot tell which
stool is the cheese on. To get around it, I added another attribute onto class
Cheese, which tells me the stool it is on when added on the stool (method
'add').
Part 4 took me around the whole night to
finish. I took a long time writing a method that finds the optimal split for
the cheeses. I believe my method optimal_split was not the most efficient, but
as long as it works, I am satisfied. I am really thankful that Professor Heap
sent us the method for moving cheeses using three stools. I just modified his
code so that it can solve the 'tour of four stools' problem.
Part 5 was relatively easy compare to part
3 and 4. I just had to implement the animation by modifying the code in
ManuelController. It only took me an hour to finish it. In general, this
assignment was a pretty good experience in working on graphics and recursion.