Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Model a maze in either Java or C++. Requirements: Maze must be a grid of at least 10 x 10 squares. From each square, an

Model a maze in either Java or C++.

Requirements: Maze must be a grid of at least 10 x 10 squares.

From each square, an agent (to come later) may or may not be able to move either up, down, left, or right depending on the walls in the maze.

There must be a start cell and a goal cell.

The must must be solvable.

The must must have at least one dead end.

The program must draw the maze (either as text or graphics).

One possible solution that we talked about in class is to store the maze as a 2D array. The coordinates in the array represent the positions of the squares. The values in the array represent the walls. We only need to store the presence of two walls (up and to the right, either present or not, for example) for a total of 4 possible values for each cell.

Separately store the location of the starting cell and goal cell.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Select suitable tools to analyze service problems.

Answered: 1 week ago