Entwickler-Ecke

Delphi Language (Object-Pascal) / CLX - Find the way in a maze?


kuzmich - Do 13.07.06 14:22
Titel: Find the way in a maze?
Too stupid to think out what could be the algorithm to solve this problem.
I`v got an maze, that consist of "0" and "1". I`ve got a start point and a end point. Is that possible to make an algorithm that finds out if there is a free way from starting to end point?

Example


Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
S
10000
10000
11111
00001
00001
00011
00010
   E


In this example the waqy exists. Where S- starting and E-ending. The way is showed as 1`s. The zeros are for example walls.


crowley - Do 13.07.06 14:26

there was a similar problem posted some days ago:

you probably should try to use the pathfinding algorithm... a usable implementation you can find here: http://www.hanisch-software.de/sonstiges/pathfinding.php