mirror of
https://gitlab.com/klmp200/LO27.git
synced 2025-07-11 15:39:24 +00:00
Changement d'architecture de projet
This commit is contained in:
62
matrixmain.c
Normal file
62
matrixmain.c
Normal file
@ -0,0 +1,62 @@
|
||||
/*********************************************************************************
|
||||
* File Name : main.c
|
||||
* Created By : klmp200
|
||||
* Creation Date : [2016-12-10 01:06]
|
||||
* Last Modified : [2016-12-10 01:07]
|
||||
* Description :
|
||||
**********************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <matrix.h>
|
||||
|
||||
int main(int argc, char **argv){
|
||||
int Rule = 256;
|
||||
int N = 1;
|
||||
int rules[] = {1, 2};
|
||||
Matrix matrix = CreateMatrix();
|
||||
Matrix m2;
|
||||
Matrix m3;
|
||||
Matrix m4;
|
||||
BooleanMatrix bmatrix = CreateBooleanMatrix(5, 5);
|
||||
|
||||
bmatrix = RandomizeBooleanMatrix(bmatrix);
|
||||
m3 = newMatrix(bmatrix);
|
||||
FreeBooleanMatrix(bmatrix);
|
||||
BasicPrintMatrix(m3);
|
||||
m4 = matrixFromRules(m3, 2, rules);
|
||||
BasicPrintMatrix(m4);
|
||||
freeMatrix(m4);
|
||||
freeMatrix(m3);
|
||||
|
||||
applyRules(matrix,Rule,N);
|
||||
matrix = SetMatrixDim(matrix,3,3);
|
||||
|
||||
BasicPrintMatrix(matrix);
|
||||
|
||||
SetCellValue(matrix,0,0,true);
|
||||
SetCellValue(matrix,0,1,true);
|
||||
SetCellValue(matrix,0,2,true);
|
||||
BasicPrintMatrix(matrix);
|
||||
|
||||
SetCellValue(matrix,0,0,false);
|
||||
SetCellValue(matrix,0,1,false);
|
||||
BasicPrintMatrix(matrix);
|
||||
|
||||
m2 = colSequenceOnMatrix(matrix, OR);
|
||||
BasicPrintMatrix(m2);
|
||||
freeMatrix(m2);
|
||||
m2 = rowSequenceOnMatrix(matrix, AND);
|
||||
BasicPrintMatrix(m2);
|
||||
|
||||
/*sumMatrix(matrix,m2);*/
|
||||
|
||||
freeMatrix(m2);
|
||||
|
||||
freeMatrix(matrix);
|
||||
return 0;
|
||||
|
||||
}
|
||||
/* todo
|
||||
*modifier DeleteListContent avec sli
|
||||
*/
|
Reference in New Issue
Block a user