I'm trying to increase of chances of getting into a certain reknowned English university to read Computer Science, so I'm trying to investigate different computational problems to add to my 'portfolio'.
I was thinking of investigating 'branched' loops, in this case using a 'maze generator' as an example. Let's say you have a grid of 10 x 10 (using multidimensional arrays), and a specified starting position for the maze generating function to begin, as well as a starting direction (i.e. N,S, E, W).
The easy part of the problem is fabricating an algorithm that will control what will happen at each square. The path might decide to continue in the same direction, turn left or right, and may even randomly branch out into two or even 3 directions. An appropriate type of square would then be displayed on the screen (e.g. with the bottom and left sides missing if the path was going East and then turned right) depending on the choices made.
The decision may depend on other possible factors, such as having to branch into an enclosed region (so as to avoid having any unused squares).
The hard part is making the function refer back TO ITSELF. Where the path of the maze branches off, the program must execute the same algorithm for the different paths in branches off into, and when those paths branch off more, again the same algorithm must be repeated. When the path comes to a dead end, that particular 'branch' must be terminated without disrupting other paths which may still be forming and branching.
How could such a task be achieved? If the function simply refers back to itself, there may be problems if a branch has to terminate, without stopping the function.
If you could give me any advice, it would be greatly appreciated, since this university placement (at Oxford) really means a lot to me. If you want to give yourself a challenge try out the task too!
Thanks,
Jamie Frost
I was thinking of investigating 'branched' loops, in this case using a 'maze generator' as an example. Let's say you have a grid of 10 x 10 (using multidimensional arrays), and a specified starting position for the maze generating function to begin, as well as a starting direction (i.e. N,S, E, W).
The easy part of the problem is fabricating an algorithm that will control what will happen at each square. The path might decide to continue in the same direction, turn left or right, and may even randomly branch out into two or even 3 directions. An appropriate type of square would then be displayed on the screen (e.g. with the bottom and left sides missing if the path was going East and then turned right) depending on the choices made.
The decision may depend on other possible factors, such as having to branch into an enclosed region (so as to avoid having any unused squares).
The hard part is making the function refer back TO ITSELF. Where the path of the maze branches off, the program must execute the same algorithm for the different paths in branches off into, and when those paths branch off more, again the same algorithm must be repeated. When the path comes to a dead end, that particular 'branch' must be terminated without disrupting other paths which may still be forming and branching.
How could such a task be achieved? If the function simply refers back to itself, there may be problems if a branch has to terminate, without stopping the function.
If you could give me any advice, it would be greatly appreciated, since this university placement (at Oxford) really means a lot to me. If you want to give yourself a challenge try out the task too!
Thanks,
Jamie Frost