diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..5c9f183 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: cpp +os: linux +script: + - make \ No newline at end of file diff --git a/README.md b/README.md index fcacf90..71dc7dc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/david-luther/SplitOrSteal.svg?branch=master)](https://travis-ci.org/david-luther/SplitOrSteal) + # SplitOrSteal **Split Or Steal** is a console application 2-player game. Each player provides their first name and then individually decides if they want to "split" or "steal." If both players choose "split" then they both get half of the prize. However, if one chooses "split" while the other chooses "steal," the player who stole gets the entire prize (and the other gets nothing). Unfortunately, if both players are greedy and both choose "steal" then they both lose! diff --git a/main.cpp b/main.cpp index a782be2..38f17cd 100644 --- a/main.cpp +++ b/main.cpp @@ -1,10 +1,12 @@ //Kevin Buffardi (with help of class) #include #include +#include using namespace std; int main() { + char play_again = ' '; //player names string player1name = ""; string player2name = ""; @@ -13,6 +15,7 @@ int main() char decision1 = ' '; char decision2 = ' '; + do { cout<<"Player 1, please enter your name: "; cin>>player1name; @@ -33,6 +36,9 @@ int main() cout<>decision2; + decision1 = tolower(decision1); + decision2 = tolower(decision2); + if(decision1 == 't' && decision2 == 's') { cout<> play_again; + +} while (tolower(play_again) == 'y'); +