added something

This commit is contained in:
Naej 2017-01-02 00:52:39 +01:00
parent ec0f959f5e
commit 1735a21274
2 changed files with 49 additions and 0 deletions

View File

@ -665,3 +665,26 @@ bool equalsMatrix(Matrix m1, Matrix m2){
return true;
}
void setRowToTrue(Matrix matrix, int RowNb){
int i =0;
for (i=0;i<m2.colCount;i++){
setCellValue(matrix,i,RowNb);
}
}
void setColToTrue(Matrix matrix, int ColNb){
int i =0;
for (i=0;i<m2.rowCount;i++){
setCellValue(matrix,ColNb,i);
}
}
void createSquare(Matrix matrix){
setRowToTrue(matrix,rowCount/4);
setRowToTrue(matrix,rowCount*3/4);
setColToTrue(matrix,colCount/4);
setColToTrue(matrix,colCount*3/4);
}

View File

@ -490,5 +490,31 @@ bool isColumnEmpty(Matrix matrix,int nb);
*/
bool isRowEmpty(Matrix matrix,int nb);
/**
* Sets a Row to true
*
* @param matrix a Matrix
* @param RowNb int number of the row
*/
void setRowToTrue(Matrix matrix, int RowNb);
/**
* Sets a Col to true
*
* @param matrix a Matrix
* @param ColNb int nuber of the col
*/
void setColToTrue(Matrix matrix, int ColNb);
/**
* Sets some values to true to create a square in the matrix
*
* @param matrix a Matrix
*/
void createSquare(Matrix matrix);
#endif