MCPcopy Create free account
hub / github.com/AnswerDotAI/gpu.cpp / canvas

Function canvas

experimental/tui.h:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14template <size_t NROWS, size_t NCOLS>
15void 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
36void rasterize(float *pos, size_t n, float maxX, float maxY, std::string &screen,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected