Here is presented an implementation of a general N-state cellular automata in Python. The three integral components are:
-
Grid - The state of each cell in the grid is dependent on it's neighbour. Provided is a sample implementation of the Conway's game of life, generalized to multiple states.
-
Agent - An agent which moves in the grid and changes it's state based on it's own state. Provided is a sample implementation of agent's like the langdon's ant and other turmites.
-
Automata - Responsible for integrating the Grid and the agent and making them interact. Also responsible for the rendering.
It was fun and wanted to challenge myself.