You are here:

C++/maze in c++

Advertisement


Question
Hello, Dear professor:
I'm really sorry to bother you again.I just want to know your algorithm works for any mazes. if you can't answer all of my questions and my question is very long, I can ask you in several times.but, if no trouble, please answer me immediate.
my question: a definition for maze, an algorithm that works for any mazes and then the data structure to save and solve it and the program in c++.
if you can't answer me please guide me how I found this information.
 Yours truly,
Masumeh.


Answer
Hello again Masumeh, thank you for the question.

There is no real way to be able to solve every single maze you could possibly be presented with ever. The algorithm I gave you was the generic way of doing it. You have to test your collision with the different walls differently, for example. Let's say your maze is ASCII. You are going to be testing collision against chars. What if your maze is a bitmap? You would have walls defined by emumerations and such. Barring that, the recursive algorithm I gave you should work for any maze.

I hope this information was helpful.

- Eddie

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Eddie

Expertise

I can answer questions about the C++ language, object oriented design and architecture. I am knowledgable in a lot of the math that goes into programming, and am certified by ExpertRating.com. I also know a good deal about graphics via OpenGL, and GUIs.

Experience

I have completed numerous games and demos created with the C++ programming language. Currently employed as a software engineer in the modeling and simulation field. I have about 7 years experience.

©2012 About.com, a part of The New York Times Company. All rights reserved.