tty-solitaire/src/tty-solitaire.c

31 lines
841 B
C
Raw Normal View History

#include <ncurses.h>
#include <malloc.h>
#include <string.h>
#include <locale.h>
2010-03-31 20:39:28 +00:00
#include "common.h"
2010-04-01 05:28:00 +00:00
#include "../lib/card.h"
int main(int argc, const char *argv[]) {
char message[] = "Welcome to tty-solitaire.";
int row_number, column_number;
setlocale(LC_ALL, ""); /* supporting unicode characters */
initscr(); /* initialize the terminal in curses mode */
raw(); /* disable line buffers */
noecho(); /* character echo is unnecessary */
keypad(stdscr, TRUE); /* enable F and arrow keys */
getmaxyx(stdscr, row_number, column_number);
mvprintw(row_number / 2 - 1,
(column_number - strlen(message)) / 2,
"%s\n",
message);
2010-04-01 06:07:48 +00:00
getch();
endwin();
puts("Game finished.");
return 0;
}