Christopher Higginbotham
CSCI 321
14 December 1999
CSCI 321 – Final Project
1. Introduction:
As you mentioned in class we should probably consider implementing the LISP program that we did research on for lab 2 and convert it to Java. For my final project I implemented Conway's Game of Life in Java. I developed a nice user interface that allows a user to enable cells and perform the rule based algorithm on the cells. I downloaded Java 1.2.2 jdk and its API in order to implement this game. I also bought "core Java Volume I-Fundamentals" in order to learn how to program in Java since the only experience I have with Java is from this class. A collaboration of our AI book, the core Java book, and the JDK API helped me create this program. Having seen other Life programs on the internet I had a pretty good idea of what type of GUI I wanted to provide to implement this game.
2. Conway's Game Of Life:
Since I had wrote about the LISP version of this game in my second lab I knew what type of internal processing needed to be performed in order to create the generations of cells. This program has a very straightforward logic to it. The most difficult part for me was setting up the grid that would contain the cells that would be processed by the life algorithm. From looking at different coding examples I knew that I was going to have to multithread this application so that the grid could process on its own. Java provides a simple threading model that was easily implemented in my program. Another thing that really helped me out was learning about the mouse and action listeners that we had to implement for the Natural Language Processing lab. I was able to incorporate them in this project with no trouble what so ever.
3. Using the Program:
3.1 Files Needed:
Life.java
Life.html
3.2 Compiling:
javac Life.java
Note: I included the .class files in the jar file in case the current JDK on Chico's system is not 1.2.2.
3.3 Running:
appletviewer Life.html
3.4 User Instructions:
Run Button: Causes the life game to run performing infinite generations.
Step Button: Causes the life game to perform one generation.
Stop Button: Causes the life game to stop.
Clear Button: Clears the grid of all the set cells.
Canvas: Left click or drag on canvas in order to set pixels.
3.5 Bundled File:
Instructions:
jar xvf bundle.jar
4.0 Coclusion:
This was a very fun program to write. I learned a lot about Java and rule based processing. I wish that I had known Java before taking this course because I could have possibly implemented a better game then Conway's Game of Life. I believed it to be a good introductory program in Java. If I had more time I would have liked to have implemented a system where the user defines the generation rules for the cells. Possibly in my own time I will create this functionality.