Skip to content

Sunflower cellular automaton definition

Jaume Ribas edited this page Jan 14, 2024 · 2 revisions

Sunflower

Cellular automaton that spreads an integer value over a grid.

Definition:

Every step, the value of each cell is divided between itself and its von Neumann neighbors. This division is an integer division, and its remainder is left at that given cell. The values that collide are added up. The algorithm effectively ends once all cells have a value too small to divide.

2D Example:

Step 0

                   
                   
        32        
                   
                   

Start off with an infinite grid padded with 0 and a single cell with value 32.

Step 1

              
      6      
   6 8 6   
      6      
              

Divide the 32 between its cell and its neighboring cells (up, down, left, right and center):

32/5 = 6

Place the result at each cell, and add the remaining 2 to the center value:

6 + 2 = 8

Step 2

    1    
  2 3 2  
1 3 8 3 1
  2 3 2  
    1    

Repeat the process for every cell, adding up the values that collide.

The new value at any given cell results from adding up the quotient of the division of its four neighbors, the quotient of its own division and the remainder of its own division. For example, for the center cell:

4×6/5 + 8/5 + 8%5 = 4 + 1 + 3 = 8

At this step all values, but the center 8, are less than 5.

Step 3

    1    
  2 4 2  
1 4 4 4 1
  2 4 2  
    1    

Finally, divide the center 8. Add the resulting 1 to its neighbors and leave the remaining 3 plus a 1 at the center.

Since all cells now have a value less than 5, we consider this the last step.