Back to the faculty page for James Tam | Return to the course web page |
Due at 4 PM. For assignment due dates see the main grid on the course webpage.
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).
|
|
|
|
|
|
|
|
![]() 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]