Question: Project 9 : A Maze of Your Own MakingImplementation ( 7 0 pts ) : Your user is traveling through a maze trying to find

Project 9: A Maze of Your Own MakingImplementation (70 pts):
Your user is traveling through a maze trying to find a prize. The maze starts out with no walls but as the user
moves walls are created in their wake. A user cannot walk into the walls created by their paths. When the user
hits the edge of their maze instead of falling off the edge, the maze is expanded in the direction of their
movement. Be sure to account for when the user hits the top or left wall of their maze. The user begins at
position 0,0 on the board.
A maze has a List of Lists where each individual element in the 2D list is a boolean indicating whether that spot
in the maze has been visited or not. The maze starts out as a 1515 maze where each element is unvisited.
Mazes also keep track of a single player's current position on the board, the user's direction, and the position
of the prize, which is set at 8,8 for convenience of testing. Remember: 2D structures are row major.
Mazes have methods for the user going to the right, to the left, and forward a certain number of spots. When
the user moves left or right they "turn" as well. The user starts out facing towards the right edge of the maze, or
"east". If in the process of their movement the user finds the prize these methods will stop the movement and
return true, returning false otherwise. For each of these movements the methods will throw a WallException,
which you will create, whenever your user runs into a wall. All movement before hitting the wall will still happen.
For instance, if the user tries to move forward 5 spaces and the wall is 3 spaces ahead of them they will still
move the 2 valid spaces. On the driver's side you will need to recover from running into a wall gracefully. You
will also throw an IllegalMoveException, which you will crea
cosc 2425| Spring 2024
Professor: Megan Avery
Topics: lists
Goal: Simulate walking through a maze while trying to find a prize
Turn In Instructions:
A zip file called project09_Firstname_Lastname.zip containing the following files:
Implementation:
Your Driver.java and Maze.java files.
Documentation:
A single pdf called project09_Firstname_Lastname.pdf that contains your objective definition
and follow up questions.
Objective Definition (10 pts): See Planning Guide
Style (10 pts): See Style Guide
Implementation (70 pts):
Your user is traveling through a maze trying to find a prize. The maze starts out with no walls but as the user
moves walls are created in their wake. A user cannot walk into the walls created by their paths. When the user
hits the edge of their maze instead of falling off the edge, the maze is expanded in the direction of their
movement. Be sure to account for when the user hits the top or left wall of their maze. The user begins at
position 0,0 on the board.
A maze has a List of Lists where each individual element in the 2D list is a boolean indicating whether that spot
in the maze has been visited or not. The maze starts out as a 1515 maze where each element is unvisited.
Mazes also keep track of a single player's current position on the board, the user's direction, and the position
of the prize, which is set at 8,8 for convenience of testing. Remember: 2D structures are row major.
Mazes have methods for the user going to the right, to the left, and forward a certain number of spots. When
the user moves left or right they "turn" as well. The user starts out facing towards the right edge of the maze, or
"east". If in the process of their movement the user finds the prize these methods will stop the movement and
return true, returning false otherwise. For each of these movements the methods will throw a WallException,
which you will create, whenever your user runs into a wall. All movement before hitting the wall will still happen.
For instance, if the user tries to move forward 5 spaces and the wall is 3 spaces ahead of them they will still
move the 2 valid spaces. On the driver's side you will need to recover from running into a wall gracefully. You
will also throw an IllegalMoveException, which you will create, whenever the user tries to move more than 5
spaces at a time in any direction or tries to move a negative amount.
The maze also has methods for getting the current position of the user and printing out the whole maze.
Unvisited spots are represented by _, visited spots by *, and the player is indicated by a @. Incorporate these
methods into the flow of your program to help the user orient themselves. The prize is a secret and not shown
in the printing of the maze.
If the user gets to the point where they have tried left, right, and forward and hits walls for all those directions
this indicates that the user has run into a dead end and the game will end.
When the user has found the prize the game ends and prints a success message for the user.
Project 9 : A Maze of Your Own

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!