Hello. I'd like to start off by saying that this is not a homework problem of any sort. I am a high school student who frequents cs competitions, and I have never been able to solve problems concerning mazes. For instance, consider the following typical example:
s1000
01000
01000
01111
00101
e1111
The s and e represent starting positions, while the 0's represent "walls" or areas that cannot be traversed. The 1's signify traversable spaces. The object is to find the shortest length from start to end, in this case 9 moves.
I have googled around for solutions to this kind of problem, and have found ones that are either too robust (I want only a few methods inside a single class) or too complex (I must be able to memorize the code to some degree).
I am sure that a concise solution exists, and I would appreciate any help.
Thanks in advance,
anon
s1000
01000
01000
01111
00101
e1111
The s and e represent starting positions, while the 0's represent "walls" or areas that cannot be traversed. The 1's signify traversable spaces. The object is to find the shortest length from start to end, in this case 9 moves.
I have googled around for solutions to this kind of problem, and have found ones that are either too robust (I want only a few methods inside a single class) or too complex (I must be able to memorize the code to some degree).
I am sure that a concise solution exists, and I would appreciate any help.
Thanks in advance,
anon
Comment