Mosaic matrix: Difference between revisions

Content added Content deleted
(C++ implementation)
m (typo)
Line 111: Line 111:
// Print each element of a matrix according to a predicate. It
// Print each element of a matrix according to a predicate. It
// will print a '1' if the predicate function is true, otherwise '0'.
// will print a '1' if the predicate function is true, otherwise '0'.
void PrintMatix(std::predicate<int, int, int> auto f, int size)
void PrintMatrix(std::predicate<int, int, int> auto f, int size)
{
{
for(int y = 0; y < size; y++)
for(int y = 0; y < size; y++)
Line 132: Line 132:
};
};


PrintMatix(mosaic, 8);
PrintMatrix(mosaic, 8);
PrintMatix(mosaic, 9);
PrintMatrix(mosaic, 9);
}
}