Maze – Starter Code
Tests
.
java – Test Methods
Maze – Starter Code
Tests.java – Test Methods
https://drive.google.com/drive/folders/
I8cvFjGW7M…
As a reminder, the purpose of this task is to apply the programming skills you have acquired to a practical and in-depth project. In this assignment, you will practice designing and using methods, strings, and
D arrays.
If you are having trouble getting started, review the material and think about how you can use each concept to accomplish your goals. We recommend reviewing the following sections:
4.
: Defining and Using Methods
;
4.1: Methods That Return Values
;
5.3: Multidimensional Arrays
;
5.4: Traversing 2D Arrays
; and
6.1: Comparing and Manipulating Strings
.
OUTLIER ODYSSEY
Your ultimate goal is to build a game called Outlier Odyssey. In this game, a player will navigate a two-dimensional map from one corner to another with limited resources while encountering hazards. During each part of the project, you will build an aspect of the game. Code from a given part may be reused in the following parts.
PART TWO: MAZE
For this assignment, you will complete a game where a player moves from the top left-hand corner of a 2D board to the bottom right-hand corner without running out of health. To accomplish this, you will place hazards in the maze, check player movement validity, and develop player-board interaction. This assignment is expected to take 4-6 hours.
The maze is a 2D String array. The game will start with a reserved cell for the player (P) and one random cell containing a magical gem (GEM)! Every other cell will be randomly assigned to one of the following hazards: wolf, bear, elk, or hare.
The player starts in the top-left corner with 50 health and must travel to the bottom-right corner without running out of health. For each turn, the player can move up, down, left, or right. After selecting a direction, the player is given a preview of the hazard in the chosen cell. Then, they can confirm the move or opt out and choose a new direction.
As the player traverses the maze, their health changes according to the hazards they reach. Once the player has visited a cell, the cell value changes to “X”—the hazard has been neutralized and the player can revisit the cell without any change in health.
The game ends when the player reaches the bottom right-hand corner of the maze or when they run out of health!
You will be responsible for completing three methods: init(), validMove(), and makeMove(). Additional methods draw
d() and runGame() have been completed for you. We have provided a second file, Tests.java, that can provide feedback on the init() and validmove() methods. You do not need to make any revisions to or submit Tests.java! To use the tests, make sure Tests.java is uploaded to your Repl.it. Then, uncomment the method calls in the main method. When you are ready to test all three methods, use runGame() and compare your output to the
sample run
.
Note: Tests.java is intended to help catch major issues. A successful test does not guarantee full credit.
METHOD ONE: init()
The init() method initializes the game board. It accepts a 2D String array as an argument and modifies that array directly to add values. The board is initialized in three steps:
“
), boar (
), elk (
“
), or hare (
“
) for every cell
Steps 2 and 3 have been completed for you. To finish the method, add code to randomly place hazards. For each cell, use the
useful code snippets
to generate a random number between 0 and 4. Then, assign the cell to a hazard based on the randomly generated number based on the table below. Make sure to capitalize the first letter of each hazard!
Randomly generated number | 3 or 4 |
Hazard |
METHOD TWO: validMove()
validMove() ensures the player is not trying to move out of the maze (out of the bounds of the 2D array). It returns a 1D array using the following logic:
METHOD THREE: makeMove()
Once a move has been validated, makeMove() implements the player movement. This is a more complex version of the player movement from
Run! makeMove() should complete three tasks:
Already visited | |||||
Health | -20 | -10 | -5 | +10 | x 100 |
You will be graded on the criteria in the rubric linked below. The purpose of this rubric is to help you understand the expectations for the assignment and improve your work. Before beginning the assignment, read the rubric to understand the criteria you will be graded on. Before you submit your assignment, use the rubric as a guide and test your program.
Start early and take breaks. Fresh eyes are the best for debugging.
Use our useful code snippets. This project requires you to work with some external tools. You do not need to work these out for yourself!
Work one step at a time! Tackle each step in order. This assignment has three methods; take it slow and finish one before starting the next.
Test frequently and repeatedly. A small, early issue can cause big problems later.
Ask for help when you need it. If you are stuck, reach out to your instructor or use the discussion boards.
Want to keep going? Try some
extra challenges
! Make sure your submitted code does not include any of these extra implementations.
STARTER FILE(S): Maze – Starter Code.Tests.java – Test Methods.That’s what I did for part Part 1:. https://drive.google.com/drive/folders/1I8cvFjGW7M…
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more