Cleanup
This commit is contained in:
17
hangman.c
17
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user