Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn order bug fix (I think) #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
30 changes: 27 additions & 3 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ int bet ()
cout << name[up] << " is the only active player and wins the pot of $" << pot << "!\n";
cash[up] += pot;
pot = 0;
dl--;
if (dl < 0){
dl = players;
}bb--;
if (bb < 0){
lb = players;
}
lb--;
if (lb < 0){
lb = players;
}
up = bb;
return 1;
}
cout << name[up] << " is up with $" << cash[up] << ".\nWhat would you like to do?\n";
Expand Down Expand Up @@ -111,6 +123,7 @@ int main ()
{
cout << "How many people are playing?\n> ";
cin >> players; players -= 1;

if (players >= 10) {
cout <<"10 players is the maximum allowed.";
exit(0);
Expand Down Expand Up @@ -158,6 +171,19 @@ int main ()
cout << name[winner] << " wins the pot of $" << pot << "!\n";
pot += cash[winner];
pot = 0;
dl--;
if (dl < 0){
dl = players;
}bb--;
if (bb < 0){
lb = players;
}
lb--;
if (lb < 0){
lb = players;
}
up = bb;

}
}
}
Expand Down Expand Up @@ -200,8 +226,6 @@ int main ()
} else if ('q' == hotkey) {break;}
}
}
++dl; if (dl > players) {dl = 0;}
++lb; if (lb > players) {lb = 0;}
++bb; if (bb > players) {bb = 0;}

} return 0;
}