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). diff --git a/main.cpp b/main.cpp index d9884f9..637a643 100644 --- a/main.cpp +++ b/main.cpp @@ -21,16 +21,28 @@ int main(){ pick = rand() % VALIDATION.size(); cout << "What are you listening to?\n"; getline(cin,input); - transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); + + if(input == "nothing"){ + return 1; + } + + cout << VALIDATION[pick] << "! Let's listen to more\n"; do{ cout << "What's next?\n"; getline(cin,input); - transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); + + if(input == "nothing"){ + return 1; + } + pick = rand() % 4; + + pick = rand() % VALIDATION.size(); + cout << VALIDATION[pick] << "!\n"; }while( input != "nothing" ); return 0; -} \ No newline at end of file +}