COMP3201 Assignment 1: Game of Life

Tasks

Write a java program called Sim134.java that simulates the Game of Life.

The user must be able to provide these two parameters as arguments when executing the program from Console (see below):

  1. The number of iterations as an integer ≥ 0.

  2. Which pattern type to initialize the cells with:

Example run command in Console: java Sim134 500 R will run life for 500 iterations, beginning with a random initial pattern of cells.

You must not ask the user to enter the arguments after the program has begun execution, and you must 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 module in the course shell to see how to do that.

These are the other requirements:


Patterns: Initial Layouts and Behaviours

You can place the patterns anywhere in your grid. Top left is usually the easiest location to place them.

Here is the initial layout for the Jam oscillator, and how it should behave when the program runs:


And here is the initial layout for the Dart glider, and how it should behave when the program runs:  


All images above are taken from and © conwaylife.com.


Video Demo

Watch this to get a good idea of what is required:


© Mark Hatcher, Department of Computer Science, Memorial University