/Game-Of-Life

John Conway's Game of Life

Primary LanguageJavaMIT LicenseMIT

🦠 Conway's Game of Life in Java 🧬

Java JavaFX

Introduction

Welcome to my implementation of John Conway's Game of Life, written in Java and using JavaFX for graphics. This program simulates the evolution of a "cellular automaton" based on a set of simple rules, resulting in a fascinating display of patterns and emergent behavior.

How to Run

The program can be run by executing the `mainGame.java` file. You will need to have the latest version of Java and JavaFX installed on your system.

Game Rules

  • Each cell in the grid is either "alive" or "dead".
  • At the beginning of the simulation, the grid is randomly populated with alive and dead cells.
  • In each iteration, or "tick" of the simulation, the following rules are applied to each cell:
    • If a cell is alive and has fewer than two live neighbors, it dies (underpopulation).
    • If a cell is alive and has more than three live neighbors, it dies (overpopulation).
    • If a cell is dead and has exactly three live neighbors, it becomes alive (reproduction).
    • Otherwise, the cell's state remains unchanged.

Controls

Press 'Next Generation' to start & keep the simulation going.

Conclusion

I hope you enjoy playing around with this simulation and observing the different patterns that emerge. The Game of Life is a great example of how simple rules can give rise to complex behavior, and I had a lot of fun bringing it to life in Java. Let me know if you have any issues or suggestions for improvements!

Happy Coding! 🚀