————————————————————————————————
See this link for more on the game of Life.
Entire set of Java classes as a single .zip file at this link.
(Open) source code to my Java applet Life (game at this link), not in any “perfect” order. First is a java file, the second html.
The main “driver” program:
User interface:
Does calculation to compute a single generation of game. Calls next to do real dirty work:
Does two things, as obvious by name — more efficient to the two put together:
PaintBoardAndComputeNextGeneration.java
PaintBoardAndComputeNextGeneration.html
Board utilities, general things that need done — put all here:
Obvious by name. Performs initializations:
Games rules, general nonsense:
Handles buttons:
Handles coordinates of board, mathematical stuff:
Do we get caught in a repeating pattern? This class handles it:
Where on screen are things placed? See next:
Instantiates objects:
Paints generation number:
What happens when game ends:
Handles popup windows:
A thread that “sleeps” a time:
Handles hiding variables:
Numeric constants:
String constants:
————————————————————————————————