Interestingly you can build some intelligence into this.

Do you mind if we discuss this openly here? I don't have the time to code at
the moment.


I'm assuming you would create 2 2 dimensional arrays.

One would hold the maze and one would hold the number of moves it had taken
to get to that point.

You would then have a recursive function that would start at the maze start
and as it traversed to the next position in the maze it would interrogate
the moves array to see if it had already visited that position in the maze
and how many moves it had taken to get there.

It would only carry on if the number of moves would be less than the number
in the moves array. It would update the moves array before moving on.

I also think that the recursive function would inherently continue along the
same direction from which it came until it hit a wall before looking to move
off that direction. (This is the intelligence bit). By doing this it will
quickly stop a lot of the recursive threads in their track.

Not sure if this is the fastest, but think it is quite a clean method.


Adam




> -----Original Message-----
> From: Adam Reynolds [mailto:[EMAIL PROTECTED]
> Sent: 15 January 2004 16:25
> To: [EMAIL PROTECTED]
> Subject: RE: [ cf-dev ] Fancy a ColdFusion Challenge?
>
>
> Should be interesting...
>
> Health warning:
> Recursive functions can play havok with your cpu time :)
>
> > -----Original Message-----
> > From: Stephen Pope [mailto:[EMAIL PROTECTED]
> > Sent: 15 January 2004 16:04
> > To: [EMAIL PROTECTED]
> > Subject: RE: [ cf-dev ] Fancy a ColdFusion Challenge?
> >
> >
> > Lol .. yup sure is .. looks good though !
> >
> > Stephen
> > -----Original Message-----
> > From: Paolo Piponi [mailto:[EMAIL PROTECTED]
> > Sent: 15 January 2004 16:06
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: [ cf-dev ] Fancy a ColdFusion Challenge?
> >
> > Now there's a way to recruit someone.
> >
> > Paolo
> >
> > > -----Original Message-----
> > > From: Adrian Lynch [mailto:[EMAIL PROTECTED]
> > > Sent: 15 January 2004 16:04
> > > To: '[EMAIL PROTECTED]'
> > > Subject: RE: [ cf-dev ] Fancy a ColdFusion Challenge?
> > >
> > >
> > > THANKS ALOT, that's my evenings gone!
> > >
> > > Looks cool though, we need more of this I reckon :O)
> > >
> > > Ade
> > >
> > > -----Original Message-----
> > > From: Tim Blair [mailto:[EMAIL PROTECTED]
> > > Sent: 15 January 2004 15:55
> > > To: [EMAIL PROTECTED]
> > > Subject: [ cf-dev ] Fancy a ColdFusion Challenge?
> > >
> > >
> > > Right you 'orrible lot...
> > >
> > > For any of you that read my blog at http://tech.badpen.com/
> > > (so that'll
> > > be, oh, no-one...) you will have seen yesterday that I've been putting
> > > together a ColdFusion Coding Contest, and the first challenge has been
> > > posted at http://tech.badpen.com/cfcontest/
> > >
> > > Your task - given a text-based 2D maze, find the shortest path out of
> > > it!
> > >
> > > "What's the point?" I hear you ask?  Well, there isn't one really.
> > > Mainly it's to give people a challenge and maybe to get
> > > people doing the
> > > sort of coding that they wouldn't normally get the chance to do during
> > > the usual mass-website-producing day in the office...  Also,
> > > I'm trying
> > > to convince the boss-man here to provide a prize...
> > >
> > > All information you should need is on the site including submission
> > > details and sample mazes to test your solver on.  The submission date
> > > has been set for Friday 13th Feb by 4pm GMT so make sure I have your
> > > entries by then!
> > >
> > > Just in case you missed it, the URL again:
> > > http://tech.badpen.com/cfcontest/
> > >
> > > Happy coding!
> > >
> > > Tim.
> > >
> > > -------------------------------------------------------
> > > RAWNET LTD - Internet, New Media and ebusiness Gurus.
> > >
> > > WE'VE MOVED - for our new address, please visit our
> > > website at http://www.rawnet.com/ or call us any time
> > > on 0800 294 24 24.
> > > -------------------------------------------------------
> > > Tim Blair
> > > Web Application Engineer, Rawnet Limited
> > > Direct Phone : +44 (0) 1753 626 654
> > > Switchboard : 0800 294 2424
> > > -------------------------------------------------------
> > > This message may contain information which is legally
> > > privileged and/or confidential.  If you are not the
> > > intended recipient, you are hereby notified that any
> > > unauthorised disclosure, copying, distribution or use
> > > of this information is strictly prohibited. Such
> > > notification notwithstanding, any comments, opinions,
> > > information or conclusions expressed in this message
> > > are those of the originator, not of rawnet limited,
> > > unless otherwise explicitly and independently indicated
> > > by an authorised representative of rawnet limited.
> > > -------------------------------------------------------
> > >
> > >
> > >
> > > --
> > > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > >
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > For human help, e-mail: [EMAIL PROTECTED]
> > >
> > > --
> > > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> > >
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > For human help, e-mail: [EMAIL PROTECTED]
> > >
> >
> > --
> > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> >
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > For human help, e-mail: [EMAIL PROTECTED]
> >
> >
> > --
> > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> >
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > For human help, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>
>
>




-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to