summaryrefslogtreecommitdiffstats
path: root/labb5/src/boggleplay.cpp
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-12-01 13:55:40 +0100
committerGustav Sörnäs <gustav@sornas.net>2020-12-01 13:55:40 +0100
commit618e5cd0dbe3d1f5c2d28586fcbe43c7bc1b79ed (patch)
tree888a3eeb39cd6c27a28a69aa8c41887b797298e8 /labb5/src/boggleplay.cpp
parent4fcb511e0f4f81453b1c97df99c56ebe1b38aade (diff)
downloadtddd86-618e5cd0dbe3d1f5c2d28586fcbe43c7bc1b79ed.tar.gz
more prints, clearer output
Diffstat (limited to 'labb5/src/boggleplay.cpp')
-rwxr-xr-xlabb5/src/boggleplay.cpp8
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) {