From c9a225140848ca6eb10bd9361a74668a3ebdcbb1 Mon Sep 17 00:00:00 2001 From: Michael Woldai Date: Wed, 24 Sep 2025 11:18:22 -0700 Subject: [PATCH 1/2] Always terminates upon nothing or user types nothing, Closes: #1 --- main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.cpp b/main.cpp index 982d05f..83236b2 100644 --- a/main.cpp +++ b/main.cpp @@ -19,11 +19,19 @@ int main(){ pick = rand() % 4; cout << "What are you listening to?\n"; getline(cin,input); + + if (input.empty()) { // exit if nothing entered + return 0; +} cout << VALIDATION[pick] << "! Let's listen to more\n"; do{ cout << "What's next?\n"; getline(cin,input); + + if (input.empty() || input == "nothing") { // exit if nothing or is user types "nothing" + return 0; +} pick = rand() % 4; cout << VALIDATION[pick] << "!\n"; }while( input != "nothing" ); From f0dccfe055654c4995a8b74f42933f271d29faf7 Mon Sep 17 00:00:00 2001 From: Michael Woldai Date: Wed, 24 Sep 2025 11:45:04 -0700 Subject: [PATCH 2/2] Added ci file for compilation, closes #2 --- .github/workflows/compile.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/compile.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..69c1ae2 --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,18 @@ +name: compile + +on: + push: + branches: "**" + pull_request: + branches: [ main ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Compile main.cpp + run: g++ -std=c++17 main.cpp -o main \ No newline at end of file