staff project download information miscellaneous
Trend Download   The Game of Life
  Download

Trend Tutorials
Trend Basics
Game of Life
One Dimensional CA
Mouse Maze
1-D Bubble Sort
Animation


More Trend Examples

 
MangoVect DownloadPicky DownloadLucy2 DownloadGRAMAUBViz DownloadgeneDBN Download

3. The RULE in action



Looking at the rule again one cell at a time to see how the rule affects each symbol in the CA space. First symbol highlighted is the top cell with the green color. This cell is highlighted to show the affects of the rule once it is applied. The cell is "alive" and has only one neighbor that is "alive". That neighbor is the cell to the lower right of the green cell. So according to the rule, lines 12 and 13, since the cell has only one "alive" neighbor, this cell colored in green will be assigned a value of 0. The cell is killed off because it had too few neighbors. Such is the rule of The Game of Life.

12 if (cell && (count<2 || count>3))
13 cell=0;

After clicking the controls to advance the rule one time, the green cell is assigned a value of 0 and is considered a "dead" cell at this point. The green cell has been assigned a value of 0, therefore it no longer shows on the CA space. A red X has been placed in the exact spot in order to show the movement of the symbols after one epoch of the rule has been run. Notice the cell marked with the red dot is not the only cell to have changed appearance in the CA space after one epoch. It is obvious by the new shape of the object that several cells have been "killed off" and others have come "alive".



Return the CA space back to it's original configuration with the rewind button (<<-)or down-arrow key as discussed earlier in the controls section.



Once the epoch number is returned to zero, the structure will be examined again. This time a different cell has been highlighted with green. This particular cell is "alive" and has 3 neighbors that are "alive". Therefore the section of the rule that applies to this cell are lines 12 and 13. The green cell has a value of something other than 0, and this time it has a count value that falls between count<2 and count>3. So the condition is proven 'false' and the cell is left alone for atleast this epoch. This is the case because of line 6 that says if no other rule applies to this cell, leave it as is.

6 default cell=cell;

Advancing to epoch 1 shows the cell remains "alive" once the rule was applied to the CA space for the first epoch. It is highlighted in green on the image below. Notice other cells have been affected by the rule, but for now the green cell has been unaffected after one epoch.



However, the situation is now a bit different for the same cell. It is still an "alive" cell, but it no longer has exactly 3 "alive" neighbors. After epoch 1, the cell only has 2 "alive" neighbors. Again the number of neighbors falls within the condition stated in line 12, so this cell is again left alone. Below is the result after the second epoch.



Continuing on to the next epoch, and concentrating on the same green highlighted cell, we can see the next epoch will "kill off" the cell because the number of "alive" neighbors is below 2. So the condition in line 12 of the code is proven true and the statement in line 13 is executed. So the cell is assigned the value of 0 and "killed off". The red X is added as a reminder of the cell location in the CA space. The red X has nothing to do with the rule, but has just been added for visual support for positioning.



After each epoch, the rule would continue to be applied to the cells in the CA space. Occasionally the combination of the rule and the configuration of the symbols in the CA space result in a pattern or trend. In the case of The Game of Life, the pattern for this particular set of symbols in the CA space results in what appears to be movement to the lower right-hand corner. The following images show the changes at certain intervals. Be sure to look at the epoch number of each image to have an idea of how many epochs must occur to get the resulting shape.

 
Epoch 0
 
Epoch 10
Epoch 25

Try selecting the ->> or the up-arrow key and let the rule continue to run. The symbols continue to move across the screen until it is stopped with the controls. This has commonly been referred to as a "crawler". There are many rules that when combined with certain set of symbols, can create the impression of movement across the CA screen.


Last modified June 13, 2008 . All rights reserved.

Contact Webmaster

lab