From bc9575e22f59a0173d29be5dc9aeec42bad43e27 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 13 Sep 2026 21:35:38 +0300 Subject: [PATCH] Also added new conditional check for whether the user guess is invalid --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 5ac9bbb..e2af0f4 100644 --- a/main.cpp +++ b/main.cpp @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) std::cout << "What's your guess (max= " << parameters.max_range <<"): "; std::cin >> user_guess; - while (std::cin.fail() || user_guess < 0) + while (std::cin.fail() || user_guess < 0 || user_guess > parameters.max_range) { std::cin.clear();