simple cell automata, algorithm numeric representation

From: adrin (adrin_at_adrin.adrin)
Date: 01/30/05


Date: Sun, 30 Jan 2005 15:25:52 +0000 (UTC)

hello im writing a simple cell automata program and i have the following
problem:
the CA is 2-dimensional and i use moore's neighbourhood(8 neighbours), a
cell can be in two states: 'dead' or 'alive', range 2.
So there are 2^9=512 different combinations for a cell's surroundings.
I would like to store an algorithm that decides about single cell's 'life'
in a number(for instance in a 64 byte type(512 bits)).
Every cell 'state' (including surrounding cells) can be stored in 9 bits.
Each bit for a different cell... that nine bits will make a number n (from
0 to 511) i can then shift the algorithm number n times right and read the
least significant bit to get the new cell state... is it a good idea?

how it is done in 'professional' programs?
in what order should i set bits in 'n' number?(starting from the middle
cell, then NE,E,SE,S,SW,W,NW,N??) i heard that there's some kind of
standard?
which number will represent the 'life' algorithm?

please help me if you can... im a total newbie in CA area :)

*a*



Relevant Pages