Apoptotic Cellular Automata

28/28 characters
Choose cell state colours


Pick initial cell states (0-9)

Pick board size (max 501 x 1000)

Score:

Cellular Automata Class:

General Information

The 1D cellular automata starts as a single row of cells. A maximum of 3 cells start off in the "alive" state, and these cells are placed in the middle of the first row, which is padded on either side with "quiescent" or dead cells (state = 0). The width of the row is one of the settings. By default, the starting population has the states 1, 2, 1. The user can pick any state from 0 to 9 (inclusive) for the starting cells. Each state has a corresponding colour that the user can also specify. The height of the 1D cellular automata specifies how many rows will be generated, including the initial row.

The 2D cellular automata begins as a board of size width × height, and the initial population of 9 cells is inserted into the middle of the board. As with the 1D version, the initial cells can have any specified state from 0 to 9 (inclusive), and the surrounding cells are all dead. The number of iterations parameter specifies how many times to calculate a new board of cells. Each board is layered on top of the previous one.

Cellular automata grow according to a rule string. The rule string can be randomly generated or specified explicitly. The rule string must have a specific length, which is calculated according to the following formula: ruleLength = neighbourhoodSize × (numStates - 1) + 1 The neighbourhood of a cell for the 1D version consists of 3 cells total; it includes the cell to left and the cell to the right of the given cell. For the 2D version, the neighbourhood has 9 cells, as it includes all cells surrounding the selected cell. Therefore, the neighbourhoodSize is 3 and 9 for 1D and 2D automata, respectively.

A cellular automata's growth pattern is derived from the starting cells and the rule string. Each element of the rule string is an integer from 0 to 9 (inclusive), thus matching the number of cell states. To get a cell's next state, the states for all cells in the neighbourhood are summed. In this specific implementation, the sum can have a maximum value of 9 + 9 + 9 = 27 (in the 1D case) or 9 × 9 = 81 (in the 2D case). Therefore, the rule strings are 28 and 82 characters in length, respectively, where the +1 accounts for the dead state (summation of zero).

A cell's new state is the index of the rule string corresponding to the cell's neighbourhood sum. Therefore, the first integer of the rule string must always be zero, such that spontaneous cell growth cannot occur (dead cells should not produce alive cells). For example, given a row of 5 cells: 0 1 2 1 0 Using an incomplete rule string of: Index : 0, 1, 2, 3, 4, 5 ... Rules : 0, 4, 7, 9, 8, 0 ... The neighbourhood summations would be: 1 3 5 3 1 Finally, the next row of cells would be: 4 9 0 9 4