The code can all be found on GitHub: here

Fire beats Grass.

Grass beats Water.

Water beats Fire.

If neighboring cells are empty, the cell is occupied by the attacker.

Each cell has a determined amount of HP to determine when it dies.

Each loss, a cell loses one HP.

Depending on mode, both the attacker and defender can mutually attack each other, else only the attacker attacks.

A large gif demonstrating the rules being applied with mutual attacks

A large gif demonstrating the rules being applied with only the attacker attacking. Note how much smoother the patterns are.

The below convergence graph shows how the populations starting from a random state tend towards homogeneousness. The end state is that each of the three elements represent approximately 33% of the occupied space.

The below graph shows when both the attacker and defender exchange an attack.

The below graph shows when only the attacker attacks each step.

A video of a larger simulation: here

Please enable JavaScript to view the comments powered by Disqus.

Disqus