1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2025-07-17 17:29:23 +00:00

Ajout d'une gui et correction de l'apply rules

This commit is contained in:
2016-12-29 03:14:07 +01:00
parent b6db74e7ee
commit 8edc9fcfd1
5 changed files with 129 additions and 27 deletions

View File

@ -9,16 +9,15 @@ Matrix applyRules (Matrix matrix,int Rules, int N){
int power = 2;
int sum = 0;
int j = 0;
Matrix tempMatrix;
Matrix tempMatrix1;
Matrix tempMatrix2;
if (Rules <= 0 || N < 1){
return matrix;
}
tempMatrix = CreateMatrix();
}
while(power<=512){
RulesMatrix[i] = Rules%power - sum;
sum = Rules%power;
@ -29,17 +28,20 @@ Matrix applyRules (Matrix matrix,int Rules, int N){
power*=2;
}
/* test code : print decomposition */
/*for (j=0;j<i;j++){
printf("%d +",RulesMatrix[j]);
}*/
tempMatrix1 = matrixFromRules(matrix, i, RulesMatrix);
for (j = 0;j<N;j++){
freeMatrix(tempMatrix);
tempMatrix = matrixFromRules(matrix,i, RulesMatrix);
for (j=1;j<N;j++){
printf("Tourne\n");
tempMatrix2 = matrixFromRules(tempMatrix1,i, RulesMatrix);
freeMatrix(tempMatrix1);
tempMatrix1.colCount = tempMatrix2.colCount;
tempMatrix1.rowCount = tempMatrix2.rowCount;
tempMatrix1.cols = tempMatrix2.cols;
tempMatrix1.rows = tempMatrix2.rows;
}
return tempMatrix;
return tempMatrix1;
}