Index
Terminal game of Minesweeper, implemented in C with ncurses.
Latest Commit
| {#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
| 12 | 12 Sep 2020 16:19 | 9e98a79 | Create game loop and page structure | Josh Stockin | 1 | 13 | 0 | G |
| 1 | #include <ncurses.h> |
| 2 | #include <string.h> |
| 3 |
|
| 4 | int centerx(const char* txt) { |
| 5 | size_t ln = strlen(txt); |
| 6 | int x = (int)(COLS / 2 - ln / 2); |
| 7 | return x; |
| 8 | } |
| 9 |
|
| 10 | int centery() { |
| 11 | int y = (LINES / 2); |
| 12 | return y; |
| 13 | } |
| 14 |
|