| 13 | |
| 14 | template <size_t NROWS, size_t NCOLS> |
| 15 | void canvas(const std::array<char, NROWS * NCOLS> &raster) { |
| 16 | printf("+"); |
| 17 | for (size_t col = 0; col < NCOLS; ++col) { |
| 18 | printf("-"); |
| 19 | } |
| 20 | printf("+\n"); |
| 21 | for (size_t row = 0; row < NROWS; ++row) { |
| 22 | printf("|"); |
| 23 | for (size_t col = 0; col < NCOLS; ++col) { |
| 24 | printf("%c", raster[row * NCOLS + col]); |
| 25 | } |
| 26 | printf("|\n"); |
| 27 | } |
| 28 | printf("+"); |
| 29 | for (size_t col = 0; col < NCOLS; ++col) { |
| 30 | printf("-"); |
| 31 | } |
| 32 | printf("+\n"); |
| 33 | } |
| 34 | |
| 35 | // double pendulum rasterizer |
| 36 | void rasterize(float *pos, size_t n, float maxX, float maxY, std::string &screen, |
nothing calls this directly
no outgoing calls
no test coverage detected