Skip to content
Snippets Groups Projects
Commit aea346fb authored by Lukas Güldenstein's avatar Lukas Güldenstein
Browse files

Fixes Bug of not identifying characters which are not part of the word

parent f1b9950c
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ GameState::guess(const std::string &guessedWord) {
for (std::string::size_type i = 0; i < guessedWord.size(); i++) {
if (word[i] == guessedWord[i]) {
matchStatus[i] = EXACT_MATCH;
} else if (word.find(guessedWord[i])) {
} else if (word.find(guessedWord[i]) != std::string::npos) {
matchStatus[i] = MATCH;
} else {
matchStatus[i] = NO_MATCH;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment