OOP_F2_Project/README.md

23 lines
2.0 KiB
Markdown

# This Java Project is a recreation of Conway's Game of Life.
# What is Conway's Game of Life:
Conway's Game of Life is a cellular automaton created by mathematician John Horton Conway in 1970. It consists of a grid of cells that can be either alive or dead, evolving through generations based on a set of simple rules: a live cell survives if it has 2 or 3 live neighbors, a dead cell becomes alive if it has exactly 3 live neighbors, and in all other cases, cells die or remain dead. This simple model can produce surprisingly complex patterns and behaviors, making it a fascinating subject for study in mathematics and computer science.
# How to use it:
Run the "Main.java" program in the "src" folder and "default package".
A window should open.
If you want to create random pixels of life on the grid, drag the random density slider bar and click on "Random Field" to generate the pixels.
In order to create manually the pixels of life, click on the "Toggle Click" button to set it "on" (can be seen in the bottom right corner) and then add the pixels of life on the grid.
If you want to add agents on the grid, press the "Toggle Click" button to set it "on" (can be seen in the bottom right corner). Then, click on a square of the grid which will turn it into a pixel of life, click again to turn it into a sheep (an agent) and if you click a third time it becomes a wolf (another agent which hunt the sheep(s)). Pressing a fourth time will turn the square back to empty.
If you want to change the world, the rule or add agents, click on their corresponding "Load ..." button. A window should appear and search them in the "resources" folder then in their dedicated folder "Agent", "Rule", "World".
In order to play the game press start and stop to stop it.
# What you can change in the code:
If you want to change the size of the grid, go in the "Simulator.java" program in the "src" and then "backend" folders. In this file, change the value of the COL_NUM and LINE_NUM to the desired size.