Question: Write a program maze_runner_modded.cpp that can stream in a maze and set up the array then take in directions to see if they can traverse

Write a program maze_runner_modded.cpp that can stream in a maze and set up the array then take in directions to see if they can traverse the custom maze.

The format for the maze will be as follows, and will always be a 10x10 size array:

Row 0 of maze Row 1 of maze ... Row 9 of maze row column of starting location row column of ending location 

When reading input file maze_and_directions.txt:

1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 1 1 0 0 0 1 0 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 9 1 ; R DDRR UU R R D D ; R DDRRD D RDDLLLDD; DRL RUDDRRDD LLLLL; 

The program should report:

$ ./maze_runner_modded < maze_and_directions.txt You are stuck in the maze. You got out of the maze. You are stuck in the maze.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!