From a91ea8a682910155b87774ff273225f0c7a5eaa6 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Tue, 13 Dec 2016 15:12:55 +0100 Subject: [PATCH] Tested compillation --- LibAutomaton/Matrix.h | 4 ++-- LibAutomaton/matrix.c | 17 +++++++++-------- main.c | 8 ++++++-- 3 files changed, 17 insertions(+), 12 deletions(-) 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;