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