Question: It is a C++ assigment. i already made the program to display the maze 10 by 10. you only please make a program alongside of
It is a C++ assigment. i already made the program to display the maze 10 by 10. you only please make a program alongside of my code to create a robot that moves through my maze. for more details see the following attached picture. Please also descride your code line.
This is my code to dispaly the maze;
#include
using namespace std;
const int SIZE = 10;
enum Values {
Space = ' ',
Wall = '+',
Exit = 'E'
};
Values maze[SIZE][SIZE];
void createMaze() {
for(int i=0; i for(int j=0; j maze[i][j] = Wall; } } maze[1][0] = Exit; maze[SIZE-3][SIZE-1] = Exit; maze[1][1] = Space; maze[1][2] = Space; maze[1][3] = Space; maze[1][4] = Space; maze[2][3] = Space; maze[2][7] = Space; maze[2][8] = Space; maze[3][3] = Space; maze[4][4] = Space; maze[4][5] = Space; maze[4][6] = Space; maze[4][7] = Space; maze[5][7] = Space; maze[6][7] = Space; maze[7][4] = Space; maze[7][5] = Space; maze[7][6] = Space; maze[7][7] = Space; } void showMaze() { for(int i=0; i for(int j=0; j cout } cout } } int main() { createMaze(); showMaze(); } 
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
