Index

ncurses-minesweeper / 4fbaed5

Terminal game of Minesweeper, implemented in C with ncurses.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
509 Sep 2020 21:112a7d780Update Makefile; begin program logicJosh Stockin1200G

Blob @ ncurses-minesweeper / src / text.c

text/plain355 bytesdownload raw
1#include <ncurses.h>
2#include <string.h>
3
4int centerx(char* txt) {
5 size_t ln = strlen(txt);
6 int x = (int)(COLS/2) - (int)(ln/2);
7 return x;
8}
9
10int centery() {
11 int y = (int)(LINES/2);
12 return y;
13}
14
15void flushright(int line, char* txt) {
16 size_t ln = strlen(txt);
17 int x = COLS - 1 - ln;
18 mvprintw(line, x, txt);
19 move(0,0);
20}
21