Question: CS 2 3 3 6 PROJECT 1 Obstacles Warrior Game Unit Test Due: 9 / 1 2 by 1 1 : 5 9 PM Project
CS PROJECT Obstacles Warrior Game
Unit Test Due: by : PM
Project Due: by : PM
KEY ITEMS: Key items are marked in red. Failure to include or complete key items will incur additional
deductions as noted beside the item.
Submission:
The file containing main must be named Main.java. points
The project files must be in a package named ObstaclesWarrior. points
All project deliverables are to be submitted in eLearning.
Zip the contents of the src directory into a single zipped file
o Make sure the zipped file has a zip extension not tar, rar, z etc. points
Programs must compile and run with Java SE
Each student is responsible for developing unit test cases to ensure the program works as
expected.
Type your name and netID in the comments at the top of all files submitted. points
Objectives: Create a Java program using programming fundamentals file IO loops, conditional
statements, arrays, functions
Problem: In an effort to win a coding competition, you decided to create an awesome Obstacles Warrior
game. The game is played on a dimensional board similar to a Chess board, but the dimensions may be
different. The minimum size of the board is x The board will have one square marked as Start with
value equals to and one square marked as Exit with value equals to Start and Exit squares cannot be
the same. Some of the board squares contains obstacles in the form of an integer that will define how
the warrior position and score will be affected. The obstacle squares can have values from to only.
The size of the board, obstacles, Start and Exit squares are all unknow to your code prior to running. This
information is stored in a file that your code will read at the beginning of the game. The board.dat file
must be read into a D array.
A warrior must start at the Start square and find their way to the Exit square. The warrior can move on
the board in any direction including diagonally, one square at a time. A warrior has a running
scoreinteger maintained from the start of the game until the warrior exits the board. If the warrior
lands on an obstacle square with a value of zero, the warrior is sent back to the starting position and the
obstacle square will become a normal square obstacle removed If the obstacle square has a negative
number, that number will be deducted from the warrior's score and the obstacle square will become a
normal square obstacle removed Each VALID move that the warrior makes without landing on an
obstacle will earn the warrior one point. The moves for the warrior are randomly generated by your
code in the form of a direction UPDOWN, LEFT, RIGHT, UPRIGHT, DOWNRIGHT, UPLEFT,
DOWNLEFT If the warrior is at the boundary of the board and your code generates an invalid move,
that move will be ignored. Your code will keep generating moves until the warrior exits at the correct
square. Once the warrior exits, your program will store the updated board information to a new file
resultboard.dat file. The program will also display the total number of valid moves, the total time
elapsed, in milliseconds, since the first move until the warrior exited the board, the final score of the
warrior and the formatted board information right aligned columns
Output Format:
Enter the board data file path: C:boarddat Repeat prompt until valid
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
