Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: compile

on:
push:
branches: '**'
pull_request:
branches: [cicd]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: compile
run: g++ -std=c++17 main.cpp
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# autovalidate

[![Build C++](https://github.com/apartridge16/autovalidate/actions/workflows/build.yml/badge.svg)](https://github.com/apartridge16/autovalidate/actions/workflows/build.yml)

I like that app too!

This repo is compatible with the [cpp-container docker container](https://github.com/ChicoState/cpp-container).
This repo is compatible with the [cpp-container docker container](https://github.com/ChicoState/cpp-container).
27 changes: 16 additions & 11 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,38 @@
#include <vector>
#include <cctype>

using std::cout;
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;
using std::transform;
using std::vector;

const vector <string> VALIDATION = {"Cool","Great","Perfect","Beautiful","Aw, yeah"};
const vector<string> VALIDATION = {"Cool", "Great", "Perfect", "Beautiful", "Aw, yeah"};

int main(){
int main()
{
string input;
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); });
getline(cin, input);
if (input == "nothing")
return 0;

cout << VALIDATION[pick] << "! Let's listen to more\n";

do{
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();
getline(cin, input);
if (input == "nothing")
break;
pick = rand() % 4;
cout << VALIDATION[pick] << "!\n";
}while( input != "nothing" );
} while (input != "nothing");

return 0;
}