It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Java Forum

Maze Solving Techniques

Maze Solving Techniques

Postby itendsnow on Wed Apr 18, 2007 12:26 pm

I'm wanting some help with regards to what is possible in java.

I'm writing a mouse than can solve a 2D maze, 16*16 cells. I'm wanting to make sure the mouse can explore the maze and then solve it based on all the routes its found. I figured I could use the faster flood algorithm once I have solved the maze since that would be allowed given I have aquired all the data. I was wondering if any one knew how I could get my mouse to explore the maze fully, recognise that fact and if it say could explore as far as it could make it follow a path back to the start of it finished search? I guess I'd have to use arrays and maybe stacks to implement this.

Any code snippets/ideas would help so I could visualise the actual code and how to start writing it.
itendsnow
 
Posts: 0
Joined: Wed Apr 18, 2007 12:24 pm

You can try this

Postby ggomez on Wed Apr 18, 2007 8:25 pm

mmm....

make one mouse class with a draw method ( something like draw(Graphic g) )
that way the mouse object can draw itself, in that class you can put some methods like location,move, etc.

Then you can draw the maze and add the mouse object, you can use the method of the mouse class to control it.

well thats somes graphics advices,

i´ll see if i can get some code.

good luck
ggomez
 
Posts: 45
Joined: Tue Apr 17, 2007 3:30 am
Location: !!!!!MéXiCo¡¡¡¡¡¡


Who is online

Users browsing this forum: No registered users and 2 guests