From ab1b047f411e1d97539a688e3e301f2fb8252645 Mon Sep 17 00:00:00 2001 From: Dylan Dorey Date: Wed, 24 Sep 2025 11:17:37 -0700 Subject: [PATCH 1/5] Fixed: always terminate upon nothing validation, closes #1 --- main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 982d05f..7e13412 100644 --- a/main.cpp +++ b/main.cpp @@ -2,6 +2,7 @@ #include #include #include +#include using std::cout; using std::cin; @@ -18,15 +19,16 @@ int main(){ srand(time(0)); pick = rand() % 4; cout << "What are you listening to?\n"; - getline(cin,input); - cout << VALIDATION[pick] << "! Let's listen to more\n"; + getline(std::cin, input); - do{ + while( input != "nothing" ) + { + cout << VALIDATION[pick] << "! Let's listen to more\n"; cout << "What's next?\n"; - getline(cin,input); + getline(std::cin,input); pick = rand() % 4; cout << VALIDATION[pick] << "!\n"; - }while( input != "nothing" ); + } return 0; } \ No newline at end of file From c88187d41bff6463449155cfb7bbc3b090297d55 Mon Sep 17 00:00:00 2001 From: Dylan Dorey Date: Wed, 24 Sep 2025 11:21:59 -0700 Subject: [PATCH 2/5] Set up continuous integration for verifying successful compilation, closes #2 --- .github/workflows/actions.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/actions.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 0000000..76a4840 --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,23 @@ +name: Build C++ + +on: + push: + branches: "**" + pull_request: + branches: [ main ] + +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: make clean && make \ No newline at end of file From 73eabc5a512338a1002c8a43cae0d1b6e92670d1 Mon Sep 17 00:00:00 2001 From: Dylan Dorey Date: Wed, 24 Sep 2025 11:33:02 -0700 Subject: [PATCH 3/5] updated small std error preventing compile, closes #1 --- main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.cpp b/main.cpp index 7e13412..4d902b1 100644 --- a/main.cpp +++ b/main.cpp @@ -18,16 +18,16 @@ int main(){ srand(time(0)); pick = rand() % 4; - cout << "What are you listening to?\n"; - getline(std::cin, input); + std::cout << "What are you listening to?\n"; + std::getline(std::cin, input); - while( input != "nothing" ) + while(input != "nothing") { - cout << VALIDATION[pick] << "! Let's listen to more\n"; - cout << "What's next?\n"; - getline(std::cin,input); + std::cout << VALIDATION[pick] << "! Let's listen to more\n"; + std::cout << "What's next?\n"; + std::getline(std::cin,input); pick = rand() % 4; - cout << VALIDATION[pick] << "!\n"; + std::cout << VALIDATION[pick] << "!\n"; } return 0; From c43c5b2952937b4eb3d86293733fefffdf1763c3 Mon Sep 17 00:00:00 2001 From: Dylan Dorey <129922313+DylanDorey@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:40:38 -0700 Subject: [PATCH 4/5] Update README.md and added status badge --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bbcf55a..b6a1c21 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # autovalidate +[![Build C++](https://github.com/DylanDorey/autovalidate/actions/workflows/actions.yml/badge.svg)](https://github.com/DylanDorey/autovalidate/actions/workflows/actions.yml) + 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). From 48bcccd068c43ca2b5a7da5dfa07a7500f097b79 Mon Sep 17 00:00:00 2001 From: Dylan Dorey <129922313+DylanDorey@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:49:21 -0700 Subject: [PATCH 5/5] Update main.cpp with algorithm library --- main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 4d902b1..49a7abd 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include using std::cout; using std::cin; @@ -31,4 +32,4 @@ int main(){ } return 0; -} \ No newline at end of file +}