diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..fafb980 --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,17 @@ +name: compile + +on: + pull_request: + branches: [ "main" ] + push: + branches: [ "devops" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Compile + run: g++ -std=c++17 main.cpp diff --git a/a.out b/a.out new file mode 100755 index 0000000..6b63525 Binary files /dev/null and b/a.out differ diff --git a/main.cpp b/main.cpp index c9679c7..000ff24 100644 --- a/main.cpp +++ b/main.cpp @@ -22,7 +22,13 @@ int main(){ srand(time(0)); pick = rand() % VALIDATION.size(); cout << "What are you listening to?\n"; +<<<<<<< HEAD input = get_input_in_lowercase(); +======= + getline(cin,input); + transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); + if (input == "nothing" || input.empty()) return 0; +>>>>>>> e174f19 (Fixed the nothing on first input) cout << VALIDATION[pick] << "! Let's listen to more\n"; do{ @@ -30,7 +36,9 @@ int main(){ input = get_input_in_lowercase(); pick = rand() % VALIDATION.size(); cout << VALIDATION[pick] << "!\n"; - }while( input != "nothing" ); + }while( input != "nothing" && !input.empty() ); + + return 0; }