From a12ef256a4a08ce22537769437cc6480d7dd21fe Mon Sep 17 00:00:00 2001 From: Ethan Harris Date: Wed, 24 Sep 2025 11:45:18 -0700 Subject: [PATCH] addresses the handling of the input 'nothing' closes #1 --- main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.cpp b/main.cpp index d9884f9..29a41d4 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include using std::cout; using std::cin; @@ -21,12 +22,18 @@ int main(){ pick = rand() % VALIDATION.size(); cout << "What are you listening to?\n"; getline(cin,input); + if(input == "nothing"){ + return 0; + } transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); cout << VALIDATION[pick] << "! Let's listen to more\n"; do{ cout << "What's next?\n"; getline(cin,input); + if(input == "nothing"){ + return 0; + } transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); pick = rand() % VALIDATION.size(); cout << VALIDATION[pick] << "!\n";