Thursday, January 24, 2013

Conway's Game of Life

Yesterday and today I worked on my most difficult programming project yet: making a version of Conway's game of life in java. After I scrapped the UI I made Tuesday, I created a completely new program that simply prints out a grid of Xs and Os to represent the living squares and the dead squares respectively. The program operates by making an object for each square and then stepping through one round at a time, each square figuring out what it will do next and then all changing at once. Here's the primary class:

Here's Citizen, the object:

It's not pretty or efficient, but it works and I made it :).

No comments:

Post a Comment