Does anybody know how to implement cellular automata in Java or C#?
Asked
Active
Viewed 5,268 times
2 Answers
2
I have write a Pseudo-Code implementation that you can use to write a .NET implementation:
function automate(cells,bornlist,survivelist,iterations)
{
loop(iterations)
{
loop(row < height)
{
loop(collumn < width)
{
if(is edge)
{
alive = true
}
else
{
num = add states of all cells around the outside (if in 3d include above and below and use less iterations)
state = cells[row,collumn]
alive = (state = 0 and bornlist.contains(num)) or (state = 1 and survivelist.contains(num))
}
cells[row,collumn] = alive ? 1 : 0
}
}
}
}
This relies on the fact that the cells have already been initialised with a random value by a noise generator such a Simplex or Perlin noise.

Tuomas Laakkonen
- 1,280
- 10
- 15
1
We need more info, like, what issues have you encountered, difficulties, etc. In the meantime, here are some links to help you:
http://www.primaryobjects.com/CMS/Article106.aspx
Edit: thanks Halil, I've edited the answer to include web.archive.org link.

Please treat your mods well.
- 4,321
- 1
- 25
- 35
-
I'm now working on an implementation of some GrowCut extension algorithm and I have never done anything like cellular automata. That's the reason I'm asking you) Thanks! Last resource was useful! – lexeme Mar 16 '11 at 14:20
-
2For those who find out that last link is dead, here is the archive: https://web.archive.org/web/20110503020104/http://www.kim-team.com/blog/2009/06/cellular-automaton-in-net/ – Halil Jan 30 '14 at 07:40