Sunday, 9 February 2014
Week 5 - Assignment 1 Progress
Well, I decided that it's probably time I spent more time and thought into the assignment this week considering it's due next week. As such, this week's slog will be going over what has been discovered while trying to solve and code the Towers of Hanoi problem. As of now, most of the main components of the program has been solved such as the recursive function responsible for finding the solution to the problem. The solution to the problem simply involved 2 recursive functions each designed specifically for either a 3 spool or 4 spool game where the function repeatedly calls itself to find the most optimal solution. The conditions are met through a series of if statements which decides where and how a cheese on the selected spool moves based on the relative sizes of the cheese in question. The main difficulty of writing the code however was the fact that the required functions was dependent on the starter program, whereby it took time to read through the starter code to understand what the functions did as well as call. As a result of dissecting the code, I was able to figure out the function calls that was missing and thereby write one up so that the code runs. Unfortunately, it would seem that the GUI will take some time to implement because I have yet to understand how it runs. This will probably be solved by later on as I start drawing conclusions and experiment with the code.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment