Hi in my algorithms class we are creating a 2D pathfinding maze where we read in the maze from a text file, and that asks the user to input where exactly they want to start and from there it finds the path while storing its path into a stack and then outputting the solution into a linked list. Right now I'm trying to get my code to update the maze after they select where they want to start and once they do that point is labeled with a '*'
In createMaze() you currently fill a local array with the maze. Instead you should pass the maze like you do for options(...).
Further more divide your createMaze() into loadMaze(char Maze[ROW][COLUMN]) and showMaze(char Maze[ROW][COLUMN]).
Do not store the '*' within the maze array. Instead store the position separately. Whenever an update is required show the maze first and then the '*'.
First off thank you for your reply! It means a lot! Secondly okay that makes sense! In the two new functions would I split the for loops as in createMaze() as well since one opens and stores the maze and the other prints it out?
Well, basically you just have to move the entiry loop from line 45 into printMaze(). The problem was line 30 which shouldn't exists (instead use maze as a paramter).
printMaze() as much as createMaze() needs the parameter char Maze[ROW][COLUMN]. Then you may call printMaze(...) within createMaze(...).
It is generally a good idea to store the moveable objects outside the array und all non movable things in the array.