Introduction to Computer Science II

Project 4 for 2007-Oct-19

The Game of Life II: Attack of The Cell Types


New cell types

The original Game of Life used the type of cells, known as Conway cells, that you used in Project 3. However, there can be other types of cells. That is, we can imagine cells that, at each evolutionary point, determine their liveness based on different numbers of live neighbors. Furthermore, the notion of a neighborhood may change, counting the liveness of some set of cells other than the standard, adjacent eight cells. Finally, we can conceive of cells that may change themselves into another type of cell under certain circumstances.

For this project, you will modify your Game of Life program to implement a number of different cell types, where each of the variations mentioned above occurs in at least one new cell type or other. The user will provide, at the command line, a selection of cell type, and the Game will then progress by using that type.

The specific cell types: We define a few nmew types of cells in addition to the already familiar Conway cell:


Getting started

Copying necessary code

Start by coping the critical classes and test files (grid initialization files and results) into your directory:

cd ~
cp -r ~sfkaplan/public/cs12/project-4 .

Changes in what my code expects

In order to support multiple cell types, my code assumes a few modest changes. Specifically, within your Game class, the constructor looks a little different, now requiring a cellType parameter:

All other changes are internal to your code. The user interface code continues to assume that there is a Cell class, and that objects of that type have a getStateAsText method that returns a char that represents the liveness of that cell type.

Cell representations

So that we can determine the types of each cell, the characters returned by the getStateAsText method must differ from once cell type to another. Here's what you should use:

Cell type Alive Alive name Dead Dead name
Amoeba * asterisk _ underscore
Conway + plus - dash
Friendly % percent ` backquote
HighLife x lower-case X . period
Morphing # pound , comma

Submitting your work

From within your project-4 subdirectory, use the following command to submit you work (all of your Java code files) when you are done:

cs12-submit project-4 *.java

This assignment is due Friday, 2007-Oct-19, at 11:59 pm

Scott F. H. Kaplan
Last modified: Wed Oct 10 15:36:17 EDT 2007