1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2024-06-29 16:18:03 +00:00

CreateMatrix

This commit is contained in:
Antoine Bartuccio 2016-12-13 17:28:13 +01:00
parent 752478a4a2
commit e310ecd342
3 changed files with 13 additions and 6 deletions

View File

@ -21,3 +21,12 @@ Matrix applyRules (Matrix matrix,int Rules, int N){
}
return matrix;
}
Matrix CreateMatrix(){
Matrix matrix;
matrix.colCount = 0;
matrix.rowCount = 0;
matrix.cols = CreateList();
matrix.rows = CreateList();
return matrix;
}

View File

@ -37,5 +37,7 @@ typedef struct Matrix {
*/
Matrix applyRules(Matrix matrix,int Rules, int N);
Matrix CreateMatrix();
#endif

6
main.c
View File

@ -11,11 +11,7 @@
#include <matrix.h>
int main(int argc, char **argv){
Matrix matrix;
matrix.cols = CreateList();
matrix.rows = CreateList();
matrix.colCount = matrix.cols->size;
matrix.rowCount= matrix.rows->size;
Matrix matrix = CreateMatrix();
int Rule = 170;
int N = 1;
applyRules(matrix,Rule,N);