2048-homework/tui.c

25 lines
512 B
C

#include "tui.h"
#include <stdio.h>
#include <curses.h>
// entering and leaving screen using ANSI escape sequence
void tui_init() {
initscr();
cbreak();
noecho();
nonl();
intrflush(stdscr, FALSE);
keypad(stdscr, TRUE);
}
void tui_destroy() {}
void tui_loop(Game *game) {
while(true){
char input = getch();
// up - 3, 107, 56
// down - 2, 106, 50
// left - 4, 104, 52
// right - 5, 108, 54
// fprintf(stderr, "%d", input);
}
}