diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..d0d4c5f --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,15 @@ +name: Build C++ + +on: + pull_request: + branches: [ main ] + commit: + branches: [ devops ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build project + run: g++ -std=c++17 main.cpp \ No newline at end of file diff --git a/main.cpp b/main.cpp index d9884f9..07a0623 100644 --- a/main.cpp +++ b/main.cpp @@ -21,16 +21,16 @@ 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); }); - cout << VALIDATION[pick] << "! Let's listen to more\n"; + if (input != "nothing"){ + 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); }); - pick = rand() % VALIDATION.size(); - cout << VALIDATION[pick] << "!\n"; - }while( input != "nothing" ); + do{ + cout << "What's next?\n"; + getline(cin,input); + pick = rand() % 4; + cout << VALIDATION[pick] << "!\n"; + }while( input != "nothing" ); + } return 0; } \ No newline at end of file