diff options
Diffstat (limited to 'labb5/src/boggleplay.cpp')
| -rwxr-xr-x | labb5/src/boggleplay.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/labb5/src/boggleplay.cpp b/labb5/src/boggleplay.cpp index f9bf79d..f41c156 100755 --- a/labb5/src/boggleplay.cpp +++ b/labb5/src/boggleplay.cpp @@ -55,7 +55,7 @@ void playOneGame(Boggle& boggle) { clearConsole(); cout << endl; // this is later replaced by the response to the prev word - if (boggle.debug_mode) cout << endl; // debug mode means two lines + if (boggle.debug_mode) cout << endl; // debug mode means two prints per guess string user_input; while (true) { if (boggle.debug_mode) cout << boggle.words_to_string(words_left) << endl << endl; @@ -67,8 +67,10 @@ void playOneGame(Boggle& boggle) { if (user_input == "") { break; } - if (!boggle.find_single_word(user_input)) { - cout << "Your word is invalid" << endl; + if (!boggle.word_is_valid(user_input)) { + cout << "Your word is invalid!" << endl; + } else if (!boggle.find_single_word(user_input)) { + cout << "Your word couldn't be found!" << endl; } else if (!boggle.word_is_unplayed(user_input)) { cout << "Your word has already been played!" << endl; } else if (user_input.length() < 4) { |
