From bc8560aec5932950a9dca269471ab860a698ba57 Mon Sep 17 00:00:00 2001 From: structix Date: Mon, 22 May 2017 22:40:18 +0200 Subject: [PATCH] Cleanup --- hangman.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/hangman.c b/hangman.c index d8afced..1183c3f 100644 --- a/hangman.c +++ b/hangman.c @@ -34,6 +34,7 @@ int main(int argc, char **argv) { initscr(); atexit(quitProgram); game_state *gs; + gs = malloc(sizeof(game_state)); initCoordinates(gs); gs->allowedMoves = DEFAULTTRIES; @@ -101,7 +102,6 @@ void startGame(game_state *gs) { updateScreen(gs); playerInput(gs); } - } @@ -147,7 +147,6 @@ void initGuessWord(game_state *gs, char *filename) { /* Random line from file */ readRandomLine(filename, gs->guessWord); } - } /* Make String all lowercase */ @@ -225,7 +224,6 @@ void drawGuessWord(game_state *gs) { } gs->wordRows = rows; //set the number of rows for clearing the screen later tempstartpos = xcounter = gs->centerx - (gs->wordLength / rows); - } for (i = startpos; i < startpos + (gs->wordLength * 2); i++) { if (xcounter >= gs->centerx + (gs->wordLength / rows)) { @@ -385,7 +383,6 @@ void readRandomLine(char *file, char *result) { /* remove \n at the end of the line */ wordlength = strlen(result); result[wordlength - 1] = '\0'; - fclose(fp); } @@ -444,17 +441,5 @@ void drawFigure(game_state *gs, int drawNext) { state++; } } - - } - - -void lala(void) { - int c; - if ((c = getch()) == 10) { - c *= 5; - } -} - -