3) The grid of hashes (#) and dots (.) in Figure below is a two-dimensional array representation of a maze. In the two-dimensional array, the hashes represent the walls of the maze and the dots represent squares in the possible paths through the maze. Moves can be made only to a location in the array that contains a dot. There is a simple algorithm for walking through a maze that guarantees finding the exit (assuming that there is an exit). If there is not an exit, you'll arrive at the starting location again. Place your right hand on the wall to your right and begin walking forward. Never remove your hand from the wall. If the maze turns to the right, you follow the wall to the right. As long as you do not remove your hand from the wall, eventually you'll arrive at the exit of the maze. There may be a shorter path than the one you've taken, but you are guaranteed to get out of the maze if you follow the algorithm. Write recursive function maze Traverse to walk through the maze. The function should receive pointer-based arguments that include a 12-by-12 character array representing the maze and the starting location of the maze. As maze Traverse attempts to locate the exit from the maze, it should place the character X in each square in the path. The function should display the maze after each move, so the user can watch as the maze is solved. M2

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

In C++,

 

M2
HINT: USE A RECURSIVE
#########
# # #
#
#
#
#
# # # # # #
#
.
# * # # #
.
#. #
*#*
###
·###
####
·####
# `# `#
. *
. *
##
.
# #
#
#
####
#
# # #
#
# #
.
*******
.
.
.
#
########
#
.
.
.
#
#
Transcribed Image Text:M2 HINT: USE A RECURSIVE ######### # # # # # # # # # # # # # # . # * # # # . #. # *#* ### ·### #### ·#### # `# `# . * . * ## . # # # # #### # # # # # # # . ******* . . . # ######## # . . . # #
3)
The grid of hashes (#) and dots (.) in Figure below is a two-dimensional array
representation of a maze. In the two-dimensional array, the hashes represent the walls of the
maze and the dots represent squares in the possible paths through the maze. Moves can be
made only to a location in the array that contains a dot.
There is a simple algorithm for walking through a maze that guarantees finding the exit
(assuming that there is an exit). If there is not an exit, you'll arrive at the starting location again.
Place your right hand on the wall to your right and begin walking forward. Never remove your
hand from the wall. If the maze turns to the right, you follow the wall to the right. As long as you
do not remove your hand from the wall, eventually you'll arrive at the exit of the maze. There
may be a shorter path than the one you've taken, but you are guaranteed to get out of the maze
if you follow the algorithm.
Write recursive function maze Traverse to walk through the maze. The function should receive
pointer-based arguments that include a 12-by-12 character array representing the maze and the
starting location of the maze. As maze Traverse attempts to locate the exit from the maze, it
should place the character X in each square in the path. The function should display the maze
after each move, so the user can watch as the maze is solved.
M2
Transcribed Image Text:3) The grid of hashes (#) and dots (.) in Figure below is a two-dimensional array representation of a maze. In the two-dimensional array, the hashes represent the walls of the maze and the dots represent squares in the possible paths through the maze. Moves can be made only to a location in the array that contains a dot. There is a simple algorithm for walking through a maze that guarantees finding the exit (assuming that there is an exit). If there is not an exit, you'll arrive at the starting location again. Place your right hand on the wall to your right and begin walking forward. Never remove your hand from the wall. If the maze turns to the right, you follow the wall to the right. As long as you do not remove your hand from the wall, eventually you'll arrive at the exit of the maze. There may be a shorter path than the one you've taken, but you are guaranteed to get out of the maze if you follow the algorithm. Write recursive function maze Traverse to walk through the maze. The function should receive pointer-based arguments that include a 12-by-12 character array representing the maze and the starting location of the maze. As maze Traverse attempts to locate the exit from the maze, it should place the character X in each square in the path. The function should display the maze after each move, so the user can watch as the maze is solved. M2
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Randomized Select Algorithm
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education