Spaces are filtered on initialization #2
This commit is contained in:
@@ -52,8 +52,12 @@ void initGuessWord(game_state *gs) {
|
|||||||
getstr(gs->guessWord);
|
getstr(gs->guessWord);
|
||||||
gs->wordLength = strlen(gs->guessWord);
|
gs->wordLength = strlen(gs->guessWord);
|
||||||
for (i = 0; i < gs->wordLength; i++) {
|
for (i = 0; i < gs->wordLength; i++) {
|
||||||
|
if (gs->guessWord[i] == ' ') { //Check for spaces if it's a sentence
|
||||||
|
gs->currentWord[i] = ' ';
|
||||||
|
} else {
|
||||||
gs->currentWord[i] = '_';
|
gs->currentWord[i] = '_';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
clear(); //clear the screen
|
clear(); //clear the screen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user