Question
Language: C++ Hey, i need help writing a function void solveMaze(vector > maze, int x, int y) {} that takes in a maze and the
Language: C++
Hey, i need help writing a function void solveMaze(vector
The existing code is as follows...
#include
using namespace std;
vector
string token;
int rowNum=0; int colNum=0; int size=0; int currSize = 0;
int test;
//get size stringstream lineStream(line); while(lineStream >> token) { size++; }
//initialize 2D vector vector
//read lines
for (int k = 0; k stringstream lineStream2(line); currSize = 0; while(lineStream2 >> token) { test = stoi(token); numbers[rowNum][currSize] = test; currSize++; } rowNum++; getline(cin, line); } //do the last line stringstream lineStream2(line); currSize = 0; while(lineStream2 >> token) { test = stoi(token); numbers[rowNum][currSize] = test; currSize++; } return numbers; } void solveMaze(vector int main() { vector solveMaze(maze, x, y); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started