diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1507baf --- /dev/null +++ b/.github/workflows/build.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: g++ main.cpp \ No newline at end of file diff --git a/main.cpp b/main.cpp index d9884f9..af63b20 100644 --- a/main.cpp +++ b/main.cpp @@ -11,8 +11,10 @@ using std::string; using std::vector; using std::transform; + const vector VALIDATION = {"Cool","Great","Perfect","Beautiful","Aw, yeah"}; + int main(){ string input; int pick; @@ -21,14 +23,27 @@ int main(){ pick = rand() % VALIDATION.size(); cout << "What are you listening to?\n"; getline(cin,input); + + if(input == "nothing"){ + return 0; + } + transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); + cout << VALIDATION[pick] << "! Let's listen to more\n"; do{ cout << "What's next?\n"; getline(cin,input); + + if(input == "nothing"){ + return 0; + } + pick = rand() % 4; + 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" );