I'm using CodeBlocks.
I have a .txt file that represents a maze, everything that is after :
are rooms:
Thefirstlineofthefileshowsthestartcoordinate,whichinthiscaseisAS
.Everyletterw
representsawall.SomyBFShasastheinitialnode(orinitialroot)theAS
.
Torepresentthislabyrinthinagraphwouldlooklikethis:
I have to represent this graph in an adjacency matrix. And I caught in that part, that I have to generate this matrix, because to do BFS the code must know the graph. I could not think of a way to represent this adjacent array by reading this file, please any suggestions, ideas, material, would help me a lot.
Note: My code can already get and store the labyrinth in an array, without the letters before the :
and without the initial coordinate. I have the complete maze in an array. To say who is the neighbor of whom and generate the graph is what I can not do.