Skip to content

dpieve/cellular-automaton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cellular Automaton Color Simulation

This is a C++ program that uses the SFML to create a visual simulation.

Each cell takes the color of its neighboring cells. A cell can have up to 8 neighbors. You can set the initial state.

Download it here and try it now!

🎥 Showcase

Below is a brief description of how the project works and what it looks like when running:

  • A grid of cells is initialized, each with a random color.
  • Walls are created to indicate those cells will not change color.
  • Each time the simulation updates, every cell selects one of its neighboring color (up, down, left, right, and diagonals).

Notice how the grid becomes more uniform with time. After many iterations, the grid will be filled with a single color.

Loading gif...

(In case you don't see the gif, wait a moment while it loads).

🛠️ Build and Run Instructions

Prerequisites

  • CMake (3.28+)
  • Git
  • C++ compiler

Clone the repository:

git clone https://github.com/dpieve/cellular-automaton.git
cd cellular-automaton

Create a new directory for the build and build it:

mkdir build
cd build
cmake ..
cmake --build .

Run the program:

./cellular-automaton

🤝 Contributions

Contributions are welcome! If you'd like to improve the project, whether by adding new features, optimizing the code, or fixing bugs, feel free to do it.

🧾 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Each cell takes the color of its neighboring cells

Topics

Resources

License

Stars

Watchers

Forks