You are writing an AI for solving a maze. The maze has 3 important objects, the player, the exit, and keys. The player is the only object that can move. To solve the maze, the player must move onto all of the keys, and then 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 other three, 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 same directory. You will also need to alert the linker to them somehow. I do not know how to do this inside of Netbeans, Codeblocks, etc, but from the terminal you should just type:
gcc Main.c Maze.c Maze.h MazeSolver.h
To run the program, you will need to supply a single argument, which is the name of the maze file. I don't know how to do this from any IDE but I assure you it is possible. To run it from the terminal, just type
./a.out (a.exe) <file_name>
Explanation of maze files:
0 - Wall
1 - Empty Space
2 - Player
3 - Key
4 - Exit
The 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 so far. Might be useful for debugging purposes.
void getCurrentPosition(int * arr) - this puts the player's row into arr, 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 conditions
int move(int newRow, int newCol) - if possible, it moves the player to the position specified. Returns 1 if move succeeds, 0 otherwise. If not possible, it prints a handy error message explaining what happened. You are definitely allowed to comment out the print statements if you get tired of seeing the error messages.
int look(int lookRow, int lookCol) - if possible, it tells you what's in the square you are looking at. It also returns the integer value of what is in the square (see maze file explanation), or -1 on a failed look. If not possible, it prints a handy error message explaining what happened. You are definitely allowed to comment out the print statements if you get tired of seeing the error messages.
15 points for each of the 10 test cases.
-50 points for cheating the system. You will know if this applies to you, don't worry.
You are automaticlaly disqualified from the bonus if:
If you are disqualified, the bonus will go to second place, and so on until someone receives the bonus.
Assignment Writing Help
Engineering Assignment Services
Do My Assignment Help
Write My Essay Services