1
0
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:
Naej
2017-01-02 01:16:49 +01:00
parent 1735a21274
commit f8bdbe19f4
2 changed files with 31 additions and 17 deletions

View File

@ -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){