160k views
4 votes
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.

1 Answer

2 votes

can you tell me what do you mean by this question?

User Ivory
by
8.4k points