Introduction Maze Solver - Source Code in C++Format Only! You Must Include the Source Code for your
Question:
Introduction Maze Solver - Source Code in C++Format Only!
You Must Include the Source Code for your application this will help your application run the process.
Describe abstract and concrete requirements for data structures and algorithms. Describe a range of standard data structures and algorithms, in terms of both functionality and performance characteristics.
By reasoning about behavior and performance, be able to critically select appropriate data structures and algorithms for a given application, Comment your program throughout you must do this do show you are following the good commenting program practices.
The application: Maze Solver Application in C++ Don't Include the Coding Down Below, as It does not Work at all, Has errors, Include Source Code relating to a Maze Solver program in C++ Format Only. Also remember to comment your programming code throughout.
Don't Include this code done below as it does not work has Errors for #include , COORD MazeExitCoords, COORD StartingPoint,SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),color);& Sleep(50);
Wrong Code:
#include
#include
const int MazeWidth = 30;
const int MazeHeight = 20;
const char MazeExit = '$';
const char Wall = '#';
const char Free = ' ';
const unsigned char SomeDude = 254;
COORD MazeExitCoords;
COORD StartingPoint;
using namespace std;
char Maze [MazeHeight][MazeWidth];
void FillDaMaze(){
MazeExitCoords.X = MazeWidth - 20;
MazeExitCoords.Y = 2;
StartingPoint.X = 3;
StartingPoint.Y = MazeHeight - 3;
for(int i = 0; i < MazeHeight; i++){
for(int ii = 0; ii < MazeWidth; ii++){
if(i == 0 || i == MazeHeight - 1 || ii == 0 || ii == MazeWidth -1){
Maze[i][ii] = Wall;
}
else{
Maze[i][ii] = Free;
}
if(i == MazeExitCoords.Y && ii == MazeExitCoords.X){
Maze[i][ii] = MazeExit;
}
else if(i == StartingPoint.Y && ii ==StartingPoint.X){
Maze[i][ii] = SomeDude;
}
}
}
}
void PrintDaMaze(int color){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),color);
for(int i = 0; i < MazeHeight; i++){
for(int ii = 0; ii < MazeWidth;ii++){
cout << Maze[i][ii];
}
cout << endl;
}
}
void FindYourWayThroughTheMaze(){
if(Maze[StartingPoint.Y + 1][StartingPoint.X] != Wall &&Maze[StartingPoint.Y + 1][StartingPoint.X ] != SomeDude){
StartingPoint.Y++;
}
else if(Maze[StartingPoint.Y][StartingPoint.X + 1] != Wall&& Maze[StartingPoint.Y][StartingPoint.X + 1] !=SomeDude){
StartingPoint.X++;
}
else if(Maze[StartingPoint.Y - 1][StartingPoint.X] != Wall&& Maze[StartingPoint.Y - 1][StartingPoint.X ] !=SomeDude){
StartingPoint.Y--;
}
else if(Maze[StartingPoint.Y][StartingPoint.X - 1] != Wall&& Maze[StartingPoint.Y][StartingPoint.X - 1] !=SomeDude){
StartingPoint.X--;
}
Maze[StartingPoint.Y][StartingPoint.X] = SomeDude;
}
int main(){
FillDaMaze();
PrintDaMaze(10);
while(StartingPoint.X != MazeExitCoords.X || StartingPoint.Y !=MazeExitCoords.Y){
FindYourWayThroughTheMaze();
system("CLS");
PrintDaMaze(10);
Sleep(50);
}
}
Your application must:
implement two different standard algorithms that solve thesame real-world problem;
make use of appropriate data structures for the application's needs;
allow you to compare the performance of the two algorithms as you vary the size of the input data.
Application: - Choose a problem you'd like to investigate e.g., Maze Solver.
- Decide on two standard algorithms that you think fit as solutions to this problem.
- Implement them both and measure and compare their performance with varying input sizes.
Make sure you have a good range of data input sizes and compare both algorithms with all input size options.
- Follow good programming practices throughout. Acknowledge and reference any external resources used in your code.