mirror of
https://gitlab.com/klmp200/LO27.git
synced 2024-11-23 03:03:19 +00:00
CreateMatrix
This commit is contained in:
parent
752478a4a2
commit
e310ecd342
@ -21,3 +21,12 @@ Matrix applyRules (Matrix matrix,int Rules, int N){
|
|||||||
}
|
}
|
||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Matrix CreateMatrix(){
|
||||||
|
Matrix matrix;
|
||||||
|
matrix.colCount = 0;
|
||||||
|
matrix.rowCount = 0;
|
||||||
|
matrix.cols = CreateList();
|
||||||
|
matrix.rows = CreateList();
|
||||||
|
return matrix;
|
||||||
|
}
|
||||||
|
@ -35,7 +35,9 @@ typedef struct Matrix {
|
|||||||
*@N : number of time the rules will be applied
|
*@N : number of time the rules will be applied
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Matrix applyRules (Matrix matrix,int Rules, int N);
|
Matrix applyRules(Matrix matrix,int Rules, int N);
|
||||||
|
|
||||||
|
Matrix CreateMatrix();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
6
main.c
6
main.c
@ -11,11 +11,7 @@
|
|||||||
#include <matrix.h>
|
#include <matrix.h>
|
||||||
|
|
||||||
int main(int argc, char **argv){
|
int main(int argc, char **argv){
|
||||||
Matrix matrix;
|
Matrix matrix = CreateMatrix();
|
||||||
matrix.cols = CreateList();
|
|
||||||
matrix.rows = CreateList();
|
|
||||||
matrix.colCount = matrix.cols->size;
|
|
||||||
matrix.rowCount= matrix.rows->size;
|
|
||||||
int Rule = 170;
|
int Rule = 170;
|
||||||
int N = 1;
|
int N = 1;
|
||||||
applyRules(matrix,Rule,N);
|
applyRules(matrix,Rule,N);
|
||||||
|
Loading…
Reference in New Issue
Block a user