Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omribraha/game-of-life
John Conway's Game of Life
https://github.com/omribraha/game-of-life
game gameoflifesimulation java javafx-gui oops-in-java
Last synced: about 1 month ago
JSON representation
John Conway's Game of Life
- Host: GitHub
- URL: https://github.com/omribraha/game-of-life
- Owner: OmriBraha
- License: mit
- Created: 2023-01-21T19:51:21.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-03T20:45:34.000Z (almost 2 years ago)
- Last Synced: 2024-09-30T03:40:20.128Z (about 1 month ago)
- Topics: game, gameoflifesimulation, java, javafx-gui, oops-in-java
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
🦠Conway's Game of Life in Java 🧬
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.
![](https://media.giphy.com/media/XqJcWCegqjFAcOZQ57/giphy.gif)
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!