From 16a325a1e262952d80d9634198c94b22b10777b5 Mon Sep 17 00:00:00 2001 From: David Luther Date: Wed, 25 Sep 2019 11:19:37 -0700 Subject: [PATCH 1/3] fixes #4 and fixes #5 - can play game again and enter upper or lower case --- main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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'); + From 9bfa1cb020880ca03f94e21692579de2cbedf044 Mon Sep 17 00:00:00 2001 From: David Luther Date: Wed, 25 Sep 2019 11:25:15 -0700 Subject: [PATCH 2/3] added Travis yml file --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .travis.yml 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 From bcbadc6e1c83ee8b1671d686b84bd15f81d8137e Mon Sep 17 00:00:00 2001 From: david-luther <31265562+david-luther@users.noreply.github.com> Date: Wed, 25 Sep 2019 11:28:11 -0700 Subject: [PATCH 3/3] Update README.md to include Travis CI badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) 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!