Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment (1/15) Game of Life Write a programcalled Life.java that simulates the Game of Life. The user must be able to provide these 3 things,

Assignment (1/15) Game of Life Write a programcalled Life.java that simulates the Game of Life. The user must be able to provide these 3 things, in this order, andas arguments when executing the program from Console:
  1. the size of the square grid (any integer)
  2. the number of iterations (any integer)
  3. which pattern type to initialize the cells with:
    • Random (enter R)
    • Glider gun (enterL)
Do not ask the user to enter the arguments after the program has begun execution, and do not ask for them in the graphical display. It\'s important that you learn how to write programs that accept command line arguments - look at the Code and Demos to see how to do that. Here is the initial layout for the Gosper glider gun: And here\'s how it should behave when the program runs: The program will use a graphical display to show the iterations. There should be sufficient delay between each iteration for the user to be able to see what\'s happening (not too fast, not too slow!), and the user should be able to see the individual cells (don\'t draw them too small!) The grid should wrap around. See Class Slides #2: \"Game of Life: Topology\". Example run command in Console: java Life 100 500 Rwill run life with a grid size 100 for 500 iterations, beginning with a random initial pattern of cells. This video shows an example of what\'s required: IMPORTANT NOTES:
  • all programming will be in Java
  • the user must be able to compile and run your code without modification from Command Prompt/Terminal/Console
    • the user must not be told to use, or need to use, an IDE to run it
      • if that happens then your program will simply score zero
    • all code necessary for your program to run must be provided as .java files
    • see Compiling and Running java in Consolefor more guidance
  • your code is going to assessed ONLY by its behaviour when run
    • we cannot debug your efforts to judge how \'close\' you were to providing working code
    • so please note that any code that cannot be run will score zero
  • if you wish, you can use the Picture.java class found in the RESOURCES section to create the graphical output for Life
    • see the PictureDemo code for how it works, including a way to magnify the display size of the cells so that they can be seen by the user!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Students also viewed these Programming questions

Question

What does the phrase calling a function mean?

Answered: 1 week ago