diff --git a/hangman.c b/hangman.c index 7a89f76..0e78a24 100644 --- a/hangman.c +++ b/hangman.c @@ -52,7 +52,11 @@ void initGuessWord(game_state *gs) { getstr(gs->guessWord); gs->wordLength = strlen(gs->guessWord); for (i = 0; i < gs->wordLength; i++) { - gs->currentWord[i] = '_'; + if (gs->guessWord[i] == ' ') { //Check for spaces if it's a sentence + gs->currentWord[i] = ' '; + } else { + gs->currentWord[i] = '_'; + } } clear(); //clear the screen }