diff --git a/report.md b/report.md index 5db41ee..0da7ccb 100644 --- a/report.md +++ b/report.md @@ -36,7 +36,32 @@ Functions *andColSequenceOnMatrix* and *orColSequenceOnMatrix* are implemented w This is the same thing for *andRowSequenceOnMatrix* and *orRowSequenceOnMatrix* : ```C +colSequenceOnMatrix(m:Matrix, operator:(function(bool, bool):bool)): Matrix +BEGIN + a:integer + b:integer + i:integer + j:integer + newM:Matrix <- createMatrix() + rowCount(newM) <- rowCount(m) + if (colCount(m) <= 1) then + colCount(newM) <- 0 + colSequenceOnMatrix <- newM + endif + colCount(newM) <- colCount(m) - 1 + + for i from 0 to colCount(m) - 2, step 1 + for j from 0 to rowCount(m) - 2, step 1 + a <- getCellValue(m, i, j) + b <- getCellValue(m, i + 1, j) + if operator(a, b) then + setCellValue(newM, i, j, true) + endif + endfor + endfor + colSequenceOnMatrix <- newM; +END ``` Here are the algorithm of the function *applyRules* and all the one related to it :