Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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();

}

image text in transcribed

Create a robot that moves through your maze. The robot makes random moves up, down, left, and right. It can only see locations that are directly adjacent to its current location. After each move, display the robot in the maze, the number of moves so far, and pause for a moment. Here is an example display. 'X' represents the robot: Move number 138 Your program should have three functions: void createMazel int &robotRow, int &robotColumn ) - initialize maze and robot starti location void showMaze( int robotRow, int robotColumn ) - display maze and current robot location bool robotMove( int &robotRow, int &robotColumn)- robot makes a random move void createMaze( int &robotRow, int &robotColumn )- initialize maze and robot startir In all three functions, robotRow and robotColumn are the position of the robot. Be sure to pass robot position as parameters in the function call do no use global variables. OPTIONAL (1 bonus point) Make your robot 'smarter', so that it escapes the maze faster. For example, you can give your robot a memory. Ask the user to select 'dumb' or 'smart' robot before each run

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

Define the spillover effect.

Answered: 1 week ago

Question

7. General Mills

Answered: 1 week ago

Question

3. Describe the strategic training and development process.

Answered: 1 week ago