From 8d5d053b5cd94f54b5346f32d6cdc22698f7c3a8 Mon Sep 17 00:00:00 2001 From: llydon Date: Wed, 24 Sep 2025 11:40:59 -0700 Subject: [PATCH] Added termination upon nothing user response, closes #1 --- main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 982d05f..bd00c7d 100644 --- a/main.cpp +++ b/main.cpp @@ -19,11 +19,17 @@ int main(){ pick = rand() % 4; cout << "What are you listening to?\n"; getline(cin,input); - cout << VALIDATION[pick] << "! Let's listen to more\n"; - + if (input == "nothing") { + return 0; + } else { + cout << VALIDATION[pick] << "! Let's listen to more\n"; + } do{ cout << "What's next?\n"; getline(cin,input); + if (input == "nothing") { + return 0; + } pick = rand() % 4; cout << VALIDATION[pick] << "!\n"; }while( input != "nothing" );