I'm sorry for not responding earlier. I've a busy weekend so I won't be able to code anything 'til mon-tue. Anyway, I asked my lecturer and he was very vague regarding the solution, but he said something like:
Start with a tree and test each depth and go deeper:
. /|\ /|\ /|\
etc. (hard to write up but you get the idea).
Doesn't really add much to our discussion though.
I might have a solution in mind that I'll try to code up soon. I'll also take a look at your code.
As for admin moving this thread to the game programming forum, I've no objections if that would keep it on the first page for longer.