diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..03a126d --- /dev/null +++ b/.github/workflows/main.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 vim + 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/main.cpp b/main.cpp index 690cf17..7ae23a8 100644 --- a/main.cpp +++ b/main.cpp @@ -23,7 +23,10 @@ int main(){ 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); }); input = get_input_in_lowercase(); + if (input == "nothing") return 0; cout << VALIDATION[pick] << "! Let's listen to more\n"; do{ @@ -41,4 +44,4 @@ string get_input_in_lowercase(){ getline(cin,in); transform(in.begin(), in.end(), in.begin(), [](unsigned char c){ return std::tolower(c); }); return in; -} \ No newline at end of file +}