Background:. You are writing an AI for solving a maze.
Added on - Sep 2019
Showing pages 1 to 1 of 2 pages
Background:You are writing an AI for solving a maze. The maze has 3 importantobjects, the player, the exit, and keys. The player is the only object thatcan move. To solve the maze, the player must move onto all of the keys, andthen move onto the exit.You have been given 4 files:Maze.c - Which contains definitions of functions I've written.Maze.h - Which contains headers for functions I've written.Main.c - Which contains the main method I've written.MazeSolver.h - Which contains methods I've started for you.You will only be submitting MazeSolver.h! Don't make edits to the otherthree, as I will be using my original copies, not your versions!Compiling & Running:To compile your project with my files, you will need them all in the samedirectory. You will also need to alert the linker to them somehow. I do notknow how to do this inside of Netbeans, Codeblocks, etc, but from the terminalyou should just type:gcc Main.c Maze.c Maze.h MazeSolver.hTo run the program, you will need to supply a single argument, which isthe name of the maze file. I don't know how to do this from any IDE but Iassure you it is possible. To run it from the terminal, just type./a.out (a.exe) <file_name>Explanation of maze files:0 - Wall1 - Empty Space2 - Player3 - Key4 - ExitThe maximum size for a maze is 500x500.Explanation of Maze.h:Here are the methods from Maze.h that you might want to use:int getNumSteps() - returns the number of steps which you have made sofar. Might be useful for debugging purposes.void getCurrentPosition(int * arr) - this puts the player's row intoarr, and the player's column into arr.void readMaze() - using this is considered cheating.void printMaze() - prints the current maze. Might be useful for debugging.int isComplete() - returns 1 if the maze is complete, and 0 otherwise.Useful for loop conditionsint move(int newRow, int newCol) - if possible, it moves the player to theposition specified. Returns 1 if move succeeds, 0 otherwise. If not possible,it prints a handy error message explaining what happened. You are definitelyallowed to comment out the print statements if you get tired of seeing theerror messages.