subject
Computers and Technology, 12.03.2021 15:40 mem8163

Given the starting point in a maze, you are to find and mark a path out of the maze is represented by a 20x20 array of 1s(representing hedges) and 0s(representing the foot-paths). There is only one exit from the maze(represented by E). You may move vertically or horizontally in any direction that contains a 0; you may not move into a square with a 1. If you move into the square with an E, you have exited the maze. If you are in a square with 1s on three sides, you must go back the way you came and try another path. You may not move diagonally. For this program, a stack class should be used.
Input: Input is a 20x20 array of characters (1s, 0s, and E) from an ASCII text data file(maze. txt); for example:
E0001110000000100100
11100011101110001111
11111000101000111000
00001110101100010010
01011000101111000110
00001110000110011110
11011100110110111000
00011110110111111101
01011011110110100001
01000000000110110111
11011011010010000000
01010010011000101011
01111000101110101110
00001110000111011001
01101011101101000011
11000110100111011010
01110000100100110011
11010111110110000000
01110100011000111110
00011001000011100010
Each data line consists of one row of maze. Starting points (i. e. a row, column pair) in the maze will be input from the keyboard.
Output: Echo print the maze complete with numbered rows and columns prior to asking the user for their starting point. For each entry into the maze, print the complete maze with an S in the starting point followed by the words ā€˜I am freeā€™ if you have found a path out of the maze or the words ā€˜Help, I am trappedā€™ if you cannot. You must also print the path (by using a series of pluses(+)) you took through the maze should one be found.
Here is a summary of algorithm:
At the beginning square we will examine the four adjacent squares and push onto the move stack the ones with a 0 or E in them.
In order to move, pop one square from the stack (Stack1). If stack is empty (when this happens it means that you are surrounded by 1s and/or +s), you are trapped. Mark the square we are in as having been visited by putting a + in the square.
Get the next move from the stack and make the square whose coordinates have just been popped the current square.
Repeat the process until you either reach the exit point or try to back track and the stack
Note that the above algorithm does not explain how one determines and marks the path to the exit from the starting point.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print?
Answers: 1
question
Computers and Technology, 22.06.2019 13:00
We as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in a computerā€™s language, however, it is preferred to have the operators on the right side of the operands, i.e. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix.write a program that takes an ā€œinfixā€ expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % (example infix expression: (7 - 3) / (2 + 2)postfix expression: 7 3 - 2 2 + /result: 1guidelines: 1. you will need to use stacks in three placesa. one for the parenthesis check [char stack]b. one during infix to postfix [char stack]c. one during evaluation [int stack]for a and b above, you can use same array and same push, pop method as both ofthem are char. but for evaluation you have int stack and you might consider to createanother push pop method to handle it. maybe push_int, pop_int, etc. or find otherstrategy to utilize existing push pop method2. you can create a function for obtaining operator priority. that function should take anoperator as input and return its priority as an integer. this function will you a lot andreduce repeated code3. during evaluation you will need to convert char into integer. example for single digit: char c = '5'; int x = c - '0';
Answers: 2
question
Computers and Technology, 22.06.2019 18:00
Martha is a healer, a healthcare provider, and an experienced nurse. she wants to share her daily experiences, as well as her 12 years of work knowledge, with people who may be interested in health and healing. which mode of internet communication can martha use?
Answers: 3
question
Computers and Technology, 22.06.2019 22:00
During physical science class ben and jerry connected three identical lightbulbs in parallel to a battery where happens when ben removes one of the lightbulbs from itā€™s socket
Answers: 2
You know the right answer?
Given the starting point in a maze, you are to find and mark a path out of the maze is represented b...
Questions
question
Mathematics, 10.11.2019 01:31
question
Geography, 10.11.2019 01:31
question
Mathematics, 10.11.2019 01:31
question
Chemistry, 10.11.2019 01:31
question
Mathematics, 10.11.2019 01:31
question
Mathematics, 10.11.2019 01:31