Block enter during the game #22

This commit is contained in:
2017-05-22 18:21:16 +02:00
parent efb519af60
commit 359e55de4b

View File

@@ -41,6 +41,7 @@ int main(int argc, char **argv) {
gs->guesses = 0; gs->guesses = 0;
gs->trollEnabled = 0; gs->trollEnabled = 0;
keypad(stdscr, FALSE); keypad(stdscr, FALSE);
nonl(); //No new line. Prevents the new line when hitting enter
curs_set(0); curs_set(0);
while ( (c = getopt_long(argc, argv, short_options, long_options, NULL)) != -1 ) { while ( (c = getopt_long(argc, argv, short_options, long_options, NULL)) != -1 ) {
@@ -86,7 +87,7 @@ int main(int argc, char **argv) {
drawFigure(gs, 0); drawFigure(gs, 0);
startGame(gs); startGame(gs);
nl(); //enable newline again
while (getch() != 10); while (getch() != 10);
clear(); clear();
free(gs); free(gs);