/*****************Default is No Change for Cells********************************/ default cell=cell; // has values of 0,1,2 and . default ctrl=ctrl; // value will be assigned when you choose the symbol /*******************************************************************************/ /************************DECLARATIONS******************************************* ********************************************************************************/ int sum; //initialize int sum int table[]={0, 0, 2, 0, 2, 0, 1}; //initialize int table /*******************************************************************************/ /**********Code to Perform the Movement From Left to Right on Screen************ ********************************************************************************/ if (ctrl==0 && left:ctrl) //if CTRL is nothing & LEFT ctrl is alive ctrl=left:ctrl-1; //assign CTRL the value LEFT CTRL -1 /*So all the code above does is check to see if the current CTRL is alive. If it is not alive, then it checks the CTRL to the left to see if it is alive. If it is, then the current CTRL is given the value of the LEFT CTRL minus 1. ********************************************************************************/ else if (no:ctrl==down:ctrl && ctrl>1) //TOP CTRL is equal to DOWN CTRL & CTRL>1 ctrl--; //only reduce by 1 if greater than 1 /***************The lines above just makes sure CTRL is reduced by 1 if in fact TOP CTRL and DOWN CTRL are equal and the CTRL value is greater than 1. This should only happen in the beginning for the first several epochs, since the TOP and DOWN CTRLs will eventually not be equal. *******************************************************************************/ /******************************************************************************** ************Code to Perform the Movement Down the Screen************************* ********************************************************************************* ***If the NO CTRL is equal to the TOP CTRL plus 1*******************************/ if (no:ctrl==top:ctrl+1 || no:ctrl==0 && top:ctrl==255) { ctrl=no:ctrl+1; sum=nw:cell+no:cell+ne:cell; cell=table[sum]; } /*******If NO CTRL is equal to TOP CTRL plus 1, then CTRL is assigned the value ******** of NO CTRL plus 1***************************************************** ******** and sum is assigned the value of NW:CELL + NO:CELL + NE:CELL********** ******** and cell is assigned the value of the array sum.*********************** *******************************************************************************/