Answered step by step
Verified Expert Solution
Question
1 Approved Answer
THE PROBLEM: For this project, you will be designing the project and writing the code from the bottom, up. You will write software to allow
THE PROBLEM: For this project, you will be designing the project and writing the code from the bottom, up. You will write software to allow a user to traverse a given maze. More specifically, your program will ask the user for a maze file name. It will open the file to load the maze into a 2-D array. It will then wait for the user to traverse the maze using the up, down, right, left arrow keys. A sample program showing you how to "capture" these key strokes will be provided in this module. The file format will contain the number of rows and the number of columns in the maze, followed by (rows X columns) characters forming the maze. There will be 4 different characters in the maze: "X": will represent a wall (space): will represent an open path @: will represent the beginning of the maze l': will represent the end of the maze. Two text files containing mazes will be provided for you. You should create additional test files. The user would like to get out of the maze with the least amount of cost. Each up, right, down, or left arrow keys the user hits, will cost money. If the user hits an open space on the path, $1 is charged and the space is changed to the@ character, and the previous location is changed to a space. If the user hits a dollar sign orn the path, $20 dollars will be deducted from the total cost. If the user hits a wall, $1000 will be charged and the user will be "kicked out" of the maze. The cost of the maze will be printed. When the user hits the '' character, representing the end of the maze, a $1 is charged for that step and the program will print an appropriate message that they have exited the maze, along with the cost of the maze. As the user traverses
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