Question
You are to write part of a computer simulation. 'Entities' inhabit a 'World'. You are given the code for the 'Entity' class definition which can
You are to write part of a computer simulation. 'Entities' inhabit a 'World'. You are given the code for the 'Entity' class definition which can be found [here]. Use this code when you implement class 'World' and the 'Driver' class. The latter will be starting execution point of the program containing the main method. You will receive credit for implementing the following capabilities in the World class. Although you aren't awarded direct credit for writing a proper Driver class it's obviously needed to run your program (but the Driver should be short - my solution was only two lines long).
Features of class World
| |
| |
| |
| |
Figure 1: The display of array elements bounded in the four directions (starting location of object at [1][1]) | |
| |
| |
Figure 2: Any out-of-bound destinations will result in an error message. Any negative coordinates will end the simulation program. | |
|
To help you see the operation of the various features there is a sample output file in the assignment directory: [output.txt] displayed below
Script started on Wed 02 Sep 2015 06:24:21 PM MDT [csc mini-a3 101 ]> java Driver - - - - - | | | | | | - - - - - | |X| | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - Destination row (0-5): -1 Destination column (0-5): -4 Row/column: -1/-4 outside world End simulation [csc mini-a3 102 ]> java Driver - - - - - | | | | | | - - - - - | |X| | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - Destination row (0-5): -1 Destination column (0-5): 2 Row/column: -1/2 outside world End simulation [csc mini-a3 103 ]> java Driver - - - - - | | | | | | - - - - - | |X| | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - Destination row (0-5): -1 Destination column (0-5): 23 Row/column: -1/23 outside world End simulation [csc mini-a3 104 ]> java Driver - - - - - | | | | | | - - - - - | |X| | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - Destination row (0-5): 0 Destination column (0-5): 7 Row/column: 0/7 outside world - - - - - | | | | | | - - - - - | |X| | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - Destination row (0-5): 4 Destination column (0-5): 2 - - - - - | | | | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - | | |X| | | - - - - - Destination row (0-5): 1 Destination column (0-5): 1 - - - - - | | | | | | - - - - - | |X| | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - | | | | | | - - - - - Destination row (0-5): -1 Destination column (0-5): 0 Row/column: -1/0 outside world End simulation [csc mini-a3 105 ]> ^Dexit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started