Index

ncurses-minesweeper / 14fa750

Terminal game of Minesweeper, implemented in C with ncurses.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
1212 Sep 2020 16:199e98a79Create game loop and page structureJosh Stockin1130G

Blob @ ncurses-minesweeper / src / draw / text.c

text/plain214 bytesdownload raw
1#include <ncurses.h>
2#include <string.h>
3
4int centerx(const char* txt) {
5 size_t ln = strlen(txt);
6 int x = (int)(COLS / 2 - ln / 2);
7 return x;
8}
9
10int centery() {
11 int y = (LINES / 2);
12 return y;
13}
14