Hacker News new | past | comments | ask | show | jobs | submit login

Consider the following:

                            Cell is currently:

          Empty                   Type 1              Type 2
   T 7 | .                 7 | .                7 | . 
   y 6 | . .               6 | . .              6 | . . 
   p 5 | . . .             5 | . . .            5 | . . .  
   e 4 | . . . .           4 | . . . .          4 | . . . .  
     3 | . . . . .         3 | . . . . .        3 | . . . . .  
   1 2 | . . . . . .       2 | . . . . . .      2 | . . . . . . 
     1 | . . . . . . .     1 | . . . . . . .    1 | . . . . . . . 
     0 | . . . . . . . .   0 | . . . . . . . .  0 | . . . . . . . .
       +-----------------    +-----------------   +-----------------
         0 1 2 3 4 5 6 7       0 1 2 3 4 5 6 7      0 1 2 3 4 5 6 7
        Type 2
For each cell, it can be one of empty, type 1, or type 2. In the matrix you specify what the next step is given 0 - 7 type 1 neighbors and 0 - 7 type 2 neighbors, the 'classic' rules would be (only one type):

          Empty                   Type 1              Type 2
   T 7 | E .               7 | E .              7 | .  
   y 6 | E .               6 | E .              6 | . . 
   p 5 | E . .             5 | E . .            5 | . . . 
   e 4 | E . . .           4 | 1 . . .          4 | . . . . 
     3 | 1 . . . .         3 | 1 . . . .        3 | . . . . . 
   1 2 | E . . . . .       2 | E . . . . .      2 | . . . . . . 
     1 | E . . . . . .     1 | E . . . . . .    1 | . . . . . . . 
     0 | E . . . . . . .   0 | E . . . . . . .  0 | . . . . . . . .
       +-----------------    +-----------------   +-----------------
         0 1 2 3 4 5 6 7       0 1 2 3 4 5 6 7      0 1 2 3 4 5 6 7
        Type 2
The way you "read" it is left to right:

If the cell is empty, matrix 1 applies. If it has 3 Type 1 neighbors exactly, then in the next iteration it will have a Type 1 value. If it has more than 3 Type 1 neighbors or fewer than 3 Type 1 neighbors it will be Empty in the next iteration.

If the cell is type 1 then matrix 2 applies. If it has 3 or 4 type 1 neighbors it stays type 1, if it has fewer than 3 or more than 4 neighbors it becomes empty on the next iteration.

There are a number of ways to expand this, you can create two 'co-species' where they follow the original rules for their species and ignore the other except for conflict (3 neighbors of type 1 and 3 neighbors of type 2). You can create 'evolving' species where an over population of type 1 neighbors generates a type 2 cell which behaves using existing rules. Etc.

You change the rules by placing E, 1, or 2 in each matrix spot. Any spot that has more than a total of 7 neighbors is invalid (so the top right diagonal half of each matrix).




Classic Life is B3/S23, not B3/S34. Am I reading your diagrams wrong?

Also, your matrices for empty and type 1 each have an extra dot after the E on the first row (I think).


Thanks for the correction. And yes when I put in the E's I didn't correctly delete the dot on the top row.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: