diff --git a/LibAutomaton/Matrix.h b/LibAutomaton/Matrix.h index afe6c13..5985834 100644 --- a/LibAutomaton/Matrix.h +++ b/LibAutomaton/Matrix.h @@ -5,7 +5,7 @@ #include /*---Matrix--- -*Abstract type that describe a boolean matrix +*Abstract type that describe a boolean matrix * *@colCount : the number of columns of the matrix *@rowIndex : the number of rows of the matrix @@ -38,4 +38,4 @@ typedef struct Matrix { Matrix applyRules (Matrix matrix,int Rules, int N); #endif - + diff --git a/LibAutomaton/matrix.c b/LibAutomaton/matrix.c index c6264cc..143dc5a 100644 --- a/LibAutomaton/matrix.c +++ b/LibAutomaton/matrix.c @@ -1,22 +1,23 @@ #include #include -#include +#include +#include Matrix applyRules (Matrix matrix,int Rules, int N){ - int pow = 2; + int power = 2; int i = 0; if (Rules <= 0){ return matrix; } else { - while (Rules%pow == 0 ){ - pow*=2; + while (Rules%power == 0 ){ + power*=2; } for (i=0;i #include -#include +#include int main(int argc, char **argv){ Matrix matrix; + matrix.cols = CreateList(); + matrix.rows = CreateList(); + matrix.colCount = matrix.cols->size; + matrix.rowCount= matrix.rows->size; int Rule = 170; int N = 1; - applyRules (matrix,Rule,N); + applyRules(matrix,Rule,N); /* Matrix matrix; cellElement * tree = NULL;