mirror of
https://gitlab.com/klmp200/LO27.git
synced 2025-07-11 15:49:23 +00:00
Added example matrix
This commit is contained in:
32
matrixmain.c
32
matrixmain.c
@ -38,17 +38,31 @@ int main(){
|
||||
BooleanMatrix bmatrix;
|
||||
|
||||
useSDL = inputYesOrNo("Do you want to use SDL library for matrix display ( interesting for big matrix only ) ?");
|
||||
printf("A random matrix will be generated\n");
|
||||
printf("Enter the number of columns of this matrix\n");
|
||||
col = safeNumberInput(1, 30000);
|
||||
printf("Enter the number of rows of this matrix\n");
|
||||
row = safeNumberInput(1, 30000);
|
||||
bmatrix = createBooleanMatrix(col, row);
|
||||
|
||||
printf("Do you prefer : 1. A matrix with random values 2. An example matrix\n");
|
||||
if (safeNumberInput(1, 2) == 2){
|
||||
printf("Enter the number of columns of this matrix\n");
|
||||
col = safeNumberInput(1, 30000);
|
||||
printf("Enter the number of rows of this matrix\n");
|
||||
row = safeNumberInput(1, 30000);
|
||||
|
||||
bmatrix = randomizeBooleanMatrix(bmatrix);
|
||||
m1 = newMatrix(bmatrix);
|
||||
freeBooleanMatrix(bmatrix);
|
||||
m1 = createMatrix();
|
||||
m1 = setMatrixDim(m1,col,row);
|
||||
createSquare(m1);
|
||||
|
||||
}else{
|
||||
printf("A random matrix will be generated\n");
|
||||
printf("Enter the number of columns of this matrix\n");
|
||||
col = safeNumberInput(1, 30000);
|
||||
printf("Enter the number of rows of this matrix\n");
|
||||
row = safeNumberInput(1, 30000);
|
||||
bmatrix = createBooleanMatrix(col, row);
|
||||
|
||||
bmatrix = randomizeBooleanMatrix(bmatrix);
|
||||
m1 = newMatrix(bmatrix);
|
||||
freeBooleanMatrix(bmatrix);
|
||||
}
|
||||
|
||||
displayMatrixGUI(m1, useSDL);
|
||||
|
||||
while (cont){
|
||||
|
Reference in New Issue
Block a user