Conways classic 'Game of Life' has been recreated here in Java.
The cellular automaton simulator is a simple but interesting way to explore how complexity can arise from simplicity.
This implementation uses a 100 × 100 grid of cells, with each generation calculated from the state of the cells surrounding it. The simulation can be started, paused, advanced one generation at a time, randomized, or cleared. Cells can also be drawn or erased directly with the mouse by either pressing the left mouse button and dragging to draw, or the right mouse button and dragging to erase.
Building the project involved separating the current and next generations, calculating neighboring cells while handling the edges of the grid, translating mouse coordinates into grid positions, and using Java Swing to handle the interface, rendering, and simulation timer.
Conway's Game of Life
Conways classic 'Game of Life' has been recreated here in Java.
The cellular automaton simulator is a simple but interesting way to explore how complexity can arise from simplicity.
This implementation uses a 100 × 100 grid of cells, with each generation calculated from the state of the cells surrounding it. The simulation can be started, paused, advanced one generation at a time, randomized, or cleared. Cells can also be drawn or erased directly with the mouse by either pressing the left mouse button and dragging to draw, or the right mouse button and dragging to erase.
Building the project involved separating the current and next generations, calculating neighboring cells while handling the edges of the grid, translating mouse coordinates into grid positions, and using Java Swing to handle the interface, rendering, and simulation timer.