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 Stockin1170G

Blob @ ncurses-minesweeper / src / draw.c

text/plain318 bytesdownload raw
1#include <ncurses.h>
2#include "text.h"
3
4int draw(int ch) {
5 if (ch == 'q' || ch == 'Q') return 1; // exit condition
6 clear();
7 mvprintw(LINES-1, COLS-6, "%ix%i", COLS, LINES);
8 refresh();
9 return 0;
10}
11
12void draw_loop(void) {
13 int ch;
14 while ((ch = getch())) {
15 if (draw(ch)) break;
16 }
17}
18