From 6dfcfcd4ac44f141d1fb076c47c8cfe4baa20ed4 Mon Sep 17 00:00:00 2001 From: structix Date: Mon, 1 May 2017 19:47:10 +0200 Subject: [PATCH] Spaces are filtered on initialization #2 --- hangman.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 }