This is a simple interactive cellular automata simulation built using the Macroquad game development framework in Rust. The simulation allows you to explore various cellular automata rule sets and visualize their behavior on a grid. The project includes a customizable dropdown menu for selecting different rule sets, and supports user interaction for modifying the grid.
- Multiple Cellular Automata Rules: Includes popular rules like Game of Life, HighLife, Brian's Brain, and others.
- Interactive Grid: Draw, erase, and clear cells directly on the grid.
- Control Simulation: Start, pause, or step through the simulation.
- Customizable Speed: Adjust the simulation speed.
The simulation includes the following rule sets:
- Game of Life: Classic Conway's Game of Life.
- HighLife: A variant of Game of Life with additional rules.
- Brian's Brain: A cyclic cellular automaton.
- Seeded: A variation where cells come to life with exactly three neighbors.
- Day & Night: A rule that supports survival patterns.
- Morley's Garden: A chaotic rule set.
- Diffusion: A rule set based on diffusion.
- Sierpinski Triangle: Generates the Sierpinski triangle pattern.
- Space: Start/Pause the simulation.
- S: Step forward one generation.
- R: Randomly fill the grid.
- C: Clear the grid.
- D: Toggle draw/erase mode.
- Mouse Click: Toggle the state of individual cells.
-
Clone the repository:
git clone https://github.com/Braeulias/cellular_automata.git cd cellular-automata
-
Build and run the project: Ensure you have Rust and Cargo installed. Then, run:
cargo run
-
Interact with the simulation:
- Use the dropdown menu to select different rule sets.
- Use the keybindings to control the simulation and interact with the grid.
- Implement custom rule logic through user input.
- Add more rule sets and visualizations.
- Enhance the UI with more interactive controls and visual feedback.
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Feel free to open issues or submit pull requests.
- Thanks to the Macroquad community for the awesome game development framework.
Enjoy experimenting with cellular automata!