From 3a8bc54802dc9b5072102fa129b60e5a70bb1c12 Mon Sep 17 00:00:00 2001 From: Cameron Sweet Date: Wed, 24 Sep 2025 11:24:23 -0700 Subject: [PATCH 1/2] Fixed termination nothing input closes #1 --- main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 982d05f..830840d 100644 --- a/main.cpp +++ b/main.cpp @@ -19,14 +19,20 @@ int main(){ pick = rand() % 4; cout << "What are you listening to?\n"; getline(cin,input); + if(input == "nothing"){ + return 1; + } cout << VALIDATION[pick] << "! Let's listen to more\n"; do{ cout << "What's next?\n"; getline(cin,input); + if(input == "nothing"){ + return 1; + } pick = rand() % 4; cout << VALIDATION[pick] << "!\n"; }while( input != "nothing" ); return 0; -} \ No newline at end of file +} From e657f19a8c8338a5d1f5629a19075552267d38b6 Mon Sep 17 00:00:00 2001 From: Cameron Sweet Date: Wed, 24 Sep 2025 11:47:18 -0700 Subject: [PATCH 2/2] Add Ci and workflow --- .github/workflows/compile.yml | 21 +++++++++++++++++++++ README.md | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) 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..3f6c88c --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,21 @@ +name: compile + +on: + push: + branches: "**" + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y -f build-essential g++ cmake + build: + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build project + run: g++ -std=c++17 main.cpp diff --git a/README.md b/README.md index bbcf55a..e00728c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # autovalidate +![Compile]https://github.com/Cbsweet123/autovalidate/actions/workflows/compile.yml/badge.svg I like that app too! -This repo is compatible with the [cpp-container docker container](https://github.com/ChicoState/cpp-container). \ No newline at end of file +This repo is compatible with the [cpp-container docker container](https://github.com/ChicoState/cpp-container).