Index

ncurses-minesweeper / e64ff2f

Terminal game of Minesweeper, implemented in C with ncurses.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
307 Sep 2020 19:42e64ff2fCreate Makefile and begin base programJosh Stockin1240G

Blob @ ncurses-minesweeper / src / main.c

text/plain472 bytesdownload raw
1#include <stdio.h>
2#include <ncurses.h>
3
4int main(void) {
5 initscr();
6 noecho();
7 clear();
8
9 mvaddstr(0, 0, "Hello, World!");
10 mvprintw(LINES-1, 0, "%d lines, %d rows", LINES, COLS);
11
12 refresh();
13 int c;
14 while ((c = getch())) {
15 move(LINES-2,0);
16 clrtoeol();
17 mvprintw(LINES-2, 0, "%i", c);
18 if (c == 27 || c == 'q' || c == 'Q') { // 27 := <ESC>
19 endwin();
20 break;
21 }
22 }
23 return 0;
24}
25