[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

Poker Issue.

daniel.kaner

10/18/2008 11:43:00 PM

I use a betting system and after 2 or 3 bets, it somehow increases the
amount of money the user/computer has. Anyone know why that happens or
how to possibly fix it? Lastly, can someone please help me with the
winning conditions for this program? Thank you very much for all the
help!

Here is the code:

#include <iostream>
#include <ctime>
#include <cmath>
#include <windows.h>

using namespace std;

int compMONEYONE, compMONEYTWO, compMONEYTHREE, compMONEYFINAL;
int compMONEY = 1000;
int playerMONEY = 1000;
int compBETONE, compBETTWO, compBETTHREE, compBETFINAL;
int placeBETONE, placeBETTWO, placeBETTHREE, placeBETFINAL;
int card[6];
int suitC[6];
int rankC[6];

const char* rank[] = {"Ace", "Two", "Three", "Four", "Five", "Six",
"Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
const char* suit[] = {"Hearts!", "Spades!", "Diamonds!", "Shamrock!"};

int numPlayers;
int random;

char choice;
char PlayAgain;

void preGame()
{
srand(GetTickCount());

//loop so that all the cards are different, if one is the same as
another, the loop restarts
do
{
//random number from 1-52 which is a card deck
card[0] = ((rand() % 52) + 1);
//cout << card[0] << endl;
card[1] = ((rand() % 52) + 1);
card[2] = ((rand() % 52) + 1);
card[3] = ((rand() % 52) + 1);
card[4] = ((rand() % 52) + 1);
card[5] = ((rand() % 52) + 1);
card[6] = ((rand() % 52) + 1);
}while(card[0] == card[1] || card[0] == card[2] || card[0] == card[3]
|| card[0] == card[4] || card[0] == card[5] || card[0] == card[6] ||
card[1] == card[2] || card[1] == card[3] || card[1] == card[4] ||
card[1] == card[5] || card[1] == card[6] || card[2] == card[3] ||
card[2] == card[4] || card[2] == card[5] || card[2] == card[6] ||
card[3] == card[4] || card[3] == card[5] || card[3] == card[6] ||
card[4] == card[5] || card[4] == card[6] || card[5] == card[6]);

//ranks - ace, one, two, three, four, five, six, seven, eight, nine,
ten, jack, queen, king
//remainder of number which then goes through the console testing loop
//ranks are all different or loop restarts
do
{
rankC[0] = (card[0] % 13);
//cout << rank[0] << endl;
rankC[1] = (card[1] % 13);
//cout << rank[1] << endl;
rankC[2] = (card[2] % 13);
//cout << rank[2] << endl;
rankC[3] = (card[3] % 13);
//cout << rank[3] << endl;
rankC[4] = (card[4] % 13);
//cout << rank[4] << endl;
rankC[5] = (card[5] % 13);
//cout << rank[5] << endl;
rankC[6] = (card[6] % 13);
//cout << rank[6] << endl;
}while(rankC[0] == rankC[1] || rankC[0] == rankC[2] || rankC[0] ==
rankC[3] || rankC[0] == rankC[4] || rankC[0] == rankC[5] || rankC[0]
== rankC[6] || rankC[1] == rankC[2] || rankC[1] == rankC[3] ||
rankC[1] == rankC[4] || rankC[1] == rankC[5] || rankC[1] == rankC[6]
|| rankC[2] == rankC[3] || rankC[2] == rankC[4] || rankC[2] ==
rankC[5] || rankC[2] == rankC[6] || rankC[3] == rankC[4] || rankC[3]
== rankC[5] || rankC[3] == rankC[6] || rankC[4] == rankC[5] ||
rankC[4] == rankC[6] || rankC[5] == rankC[6]);

//4 suits - hearts, spades, shamrocks, diamonds
suitC[0] = (rand() % 4);
suitC[1] = (rand() % 4);
suitC[2] = (rand() % 4);
suitC[3] = (rand() % 4);
suitC[4] = (rand() % 4);
suitC[5] = (rand() % 4);
suitC[6] = (rand() % 4);

/* if(numPlayers > 5 || numPlayers < 1)
{
cout << "Please enter the number of players that you would like to
include in this game(no more than 5): ";
cin >> numPlayers;
}*/
}

void betGame()
{

cout << "Player Money Total: $" << playerMONEY << endl;
cout << "Computer Money Total: $" << compMONEY << endl;
// random = (rand() % 1);

// if(random == 0)
// {
cout << "Small blind: $25 put up by the computer." << endl;
cout << "Big blind: $50 put up by the player." << endl;
cout << "Player Money Total: $" << playerMONEY - 50 << endl;
cout << "Computer Money Total: $" << compMONEY - 25 << endl;
compMONEYONE = compMONEY - 25;
/* }
else
{
cout << "Small blind: $25 put up by the player." << endl;
cout << "Big blind: $50 put up by the computer." << endl;
cout << "Player Money Total: $" << playerMONEY - 25 << endl;
cout << "Computer Money Total: $" << compMONEY - 50 << endl;
}*/

cout << "Player's First Card: " << rank[rankC[0]] << " of " <<
suit[suitC[0]] << endl;

cout << "Player's Second Card: " << rank[rankC[1]] << " of " <<
suit[suitC[1]] << endl;

//SECOND YOU FLIP 1 CARD AND YOU SEE YOUR CARDS AND 1 CARD -- BET #2

cout << "How much would you like to bet?";
cin >> placeBETONE;
compBETONE = (rand() % compMONEYONE);
cout << "Computer bet: " << compBETONE << endl;
cout << "Player Money Total: $" << playerMONEY - 50 - placeBETONE <<
endl;
cout << "Computer Money Total: $" << compMONEY - 25 - compBETONE <<
endl;
compMONEYTWO = compMONEY - 25 - compBETONE;


cout << "Flop First Card: " << rank[rankC[2]] << " of " <<
suit[suitC[2]] << endl;

cout << "Flop Second Card: " << rank[rankC[3]] << " of " <<
suit[suitC[3]] << endl;

cout << "Flop Third Card: " << rank[rankC[4]] << " of " <<
suit[suitC[4]] << endl;


placeBETTWO = -1;
while(placeBETTWO < 0 || placeBETTWO > 25)
{
cout << "How much would you like to bet?";
cin >> placeBETTWO;
compBETTWO = (rand() % compMONEYTWO);
cout << "Computer bet: " << compBETTWO << endl;
cout << "Player Money Total: $" << playerMONEY - 50 - placeBETONE -
placeBETTWO << endl;
cout << "Computer Money Total: $" << compMONEY - 25 - compBETONE -
compBETTWO << endl;
compMONEYTHREE = compMONEY - 25 - compBETONE - compBETTWO;

cout << "Turn Card: " << rank[rankC[5]] << " of " << suit[suitC[5]] <<
endl;
}

placeBETTHREE = -1;
while(placeBETTHREE < 0 || placeBETTHREE > 25)
{
cout << "How much would you like to bet?";
cin >> placeBETTHREE;
compBETTHREE = (rand() % compMONEYTHREE);
cout << "Computer bet: " << compBETTHREE << endl;
cout << "Player Money Total: $" << playerMONEY - 50 - placeBETONE -
placeBETTWO - placeBETTHREE << endl;
cout << "Computer Money Total: $" << compMONEY - 25 - compBETONE -
compBETTWO - compBETTHREE << endl;
compMONEYFINAL = compMONEY - 25 - compBETONE - compBETTWO -
compBETTHREE;

cout << "River Card: " << rank[rankC[6]] << " of " << suit[suitC[6]]
<< endl;;
}

placeBETFINAL = -1;
while(placeBETFINAL < 0 || placeBETFINAL > 25)
{
cout << "How much would you like to bet?";
cin >> placeBETFINAL;
compBETFINAL = (rand() % compMONEYFINAL);
cout << "Computer bet: " << compBETFINAL << endl;
cout << "Player Money Total: $" << playerMONEY - 50 - placeBETONE -
placeBETTWO - placeBETTHREE - placeBETFINAL << endl;
cout << "Computer Money Total: $" << compMONEY - 25 - compBETONE -
compBETTWO - compBETTHREE - compBETFINAL << endl;
}

//WINNING CONDITIONS

cout << "Do You Want To Play Again: " << endl;
cin >> PlayAgain;
}

int main()
{
do
{
cout << "Welcome to Texas Hold 'Em!" << endl;

preGame();
betGame();

}while(PlayAgain == 'y');

}
3 Answers

Kai-Uwe Bux

10/19/2008 12:14:00 AM

0

daniel.kaner@gmail.com wrote:

> I use a betting system and after 2 or 3 bets, it somehow increases the
> amount of money the user/computer has. Anyone know why that happens or
> how to possibly fix it? Lastly, can someone please help me with the
> winning conditions for this program? Thank you very much for all the
> help!
>
> Here is the code:
>
> #include <iostream>
> #include <ctime>
> #include <cmath>
> #include <windows.h>

<windows.h> isn't a standard header. You only need it for GetTickCount(),
for which there are portable alternatives.

You also need the header <cstdlib> for rand().


> using namespace std;
>
> int compMONEYONE, compMONEYTWO, compMONEYTHREE, compMONEYFINAL;
> int compMONEY = 1000;
> int playerMONEY = 1000;
> int compBETONE, compBETTWO, compBETTHREE, compBETFINAL;
> int placeBETONE, placeBETTWO, placeBETTHREE, placeBETFINAL;
> int card[6];
> int suitC[6];
> int rankC[6];

You actually need arrays of length 7. Writing beyond the bounds of an array
is undefined behavior, and might cause the strange behavior that you are
observing.

Also, why all the static variables?


> const char* rank[] = {"Ace", "Two", "Three", "Four", "Five", "Six",
> "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
> const char* suit[] = {"Hearts!", "Spades!", "Diamonds!", "Shamrock!"};
>
> int numPlayers;
> int random;

random is an identifier declared by one of the headers. You have a name
conflict.

> char choice;
> char PlayAgain;
>
> void preGame()
> {
> srand(GetTickCount());
>
> //loop so that all the cards are different, if one is the same as
> another, the loop restarts
> do
> {
> //random number from 1-52 which is a card deck
> card[0] = ((rand() % 52) + 1);
> //cout << card[0] << endl;
> card[1] = ((rand() % 52) + 1);
> card[2] = ((rand() % 52) + 1);
> card[3] = ((rand() % 52) + 1);
> card[4] = ((rand() % 52) + 1);
> card[5] = ((rand() % 52) + 1);
> card[6] = ((rand() % 52) + 1);
> }while(card[0] == card[1] || card[0] == card[2] || card[0] == card[3]
> || card[0] == card[4] || card[0] == card[5] || card[0] == card[6] ||
> card[1] == card[2] || card[1] == card[3] || card[1] == card[4] ||
> card[1] == card[5] || card[1] == card[6] || card[2] == card[3] ||
> card[2] == card[4] || card[2] == card[5] || card[2] == card[6] ||
> card[3] == card[4] || card[3] == card[5] || card[3] == card[6] ||
> card[4] == card[5] || card[4] == card[6] || card[5] == card[6]);

This is not so good.

a) The %52 approach introduces a bias. (Not all that big)
b) The code is longish.
c) Collisions are more likely than you think. Thus, it can take a long time
for this loop to finish. (Though, not as long as the next loop.)

An alternative approach would be to put all 52 cards into one array and use
one call to std::random_shuffle(). Then, use the first 7 of that array.


> //ranks - ace, one, two, three, four, five, six, seven, eight, nine,
> ten, jack, queen, king
> //remainder of number which then goes through the console testing loop
> //ranks are all different or loop restarts
> do
> {
> rankC[0] = (card[0] % 13);
> //cout << rank[0] << endl;
> rankC[1] = (card[1] % 13);
> //cout << rank[1] << endl;
> rankC[2] = (card[2] % 13);
> //cout << rank[2] << endl;
> rankC[3] = (card[3] % 13);
> //cout << rank[3] << endl;
> rankC[4] = (card[4] % 13);
> //cout << rank[4] << endl;
> rankC[5] = (card[5] % 13);
> //cout << rank[5] << endl;
> rankC[6] = (card[6] % 13);
> //cout << rank[6] << endl;
> }while(rankC[0] == rankC[1] || rankC[0] == rankC[2] || rankC[0] ==
> rankC[3] || rankC[0] == rankC[4] || rankC[0] == rankC[5] || rankC[0]
> == rankC[6] || rankC[1] == rankC[2] || rankC[1] == rankC[3] ||
> rankC[1] == rankC[4] || rankC[1] == rankC[5] || rankC[1] == rankC[6]
> || rankC[2] == rankC[3] || rankC[2] == rankC[4] || rankC[2] ==
> rankC[5] || rankC[2] == rankC[6] || rankC[3] == rankC[4] || rankC[3]
> == rankC[5] || rankC[3] == rankC[6] || rankC[4] == rankC[5] ||
> rankC[4] == rankC[6] || rankC[5] == rankC[6]);

This loop does not actually change the cards. So, if there is a rank
collision, this loop will not terminate. Are you sure, you want the loop?


> //4 suits - hearts, spades, shamrocks, diamonds
> suitC[0] = (rand() % 4);
> suitC[1] = (rand() % 4);
> suitC[2] = (rand() % 4);
> suitC[3] = (rand() % 4);
> suitC[4] = (rand() % 4);
> suitC[5] = (rand() % 4);
> suitC[6] = (rand() % 4);
>
> /* if(numPlayers > 5 || numPlayers < 1)
> {
> cout << "Please enter the number of players that you would like to
> include in this game(no more than 5): ";
> cin >> numPlayers;
> }*/
> }
>
> void betGame()
> {
[snip]

I guess, some poker knowledge would be needed to scrutinize this part.


> cout << "Do You Want To Play Again: " << endl;
> cin >> PlayAgain;
> }
>
> int main()
> {
> do
> {
> cout << "Welcome to Texas Hold 'Em!" << endl;
>
> preGame();
> betGame();
>
> }while(PlayAgain == 'y');
>
> }

The idea of setting a global variable (PlayAgain) in betGame() and read it
in main() is strange.


Best

Kai-Uwe Bux

James Kanze

10/19/2008 4:17:00 PM

0

On Oct 19, 2:13 am, Kai-Uwe Bux <jkherci...@gmx.net> wrote:
> daniel.ka...@gmail.com wrote:
> > I use a betting system and after 2 or 3 bets, it somehow
> > increases the amount of money the user/computer has. Anyone
> > know why that happens or how to possibly fix it? Lastly, can
> > someone please help me with the winning conditions for this
> > program? Thank you very much for all the help!

> > Here is the code:

[...]
> > int random;

> random is an identifier declared by one of the headers. You
> have a name conflict.

Which one? There's no random defined in any standard header,
that I know of.

If he's compiling for Posix, there's one in stdlib.h. If he's
using <cstdlib> or if he hasn't defined any of the Posix feature
test macros, however, this shouldn't be a problem. And since
there's nothing in his code which depends on Posix (actually, I
didn't verify this, but since he did include <windows.h>, it
seems like a good guess), he shouldn't define any of the feature
test macros.

[...]
> > srand(GetTickCount());

You said that there were valid portable alternatives to
GetTickCount(). I'd like to know what they are. (The key
operative word here is "portable". Under Unix, I open
/dev/random, and read from that. But that's not portable. When
it fails, I usually use a mix of the machine's IP address, the
process id, and the current time, but there's no way of getting
the first two portably, that I know. And after reading the
documentation, GetTickCount() sounds like it would be almost as
good as reading from /dev/random, for a single use.)

> > // loop so that all the cards are different, if one is the same as
> > // another, the loop restarts

[...]
> An alternative approach would be to put all 52 cards into one
> array and use one call to std::random_shuffle(). Then, use the
> first 7 of that array.

That's what I was going to suggest. It has the added advantage
that it's easily modified to drawing two or more hands. (I'd
like to see how he would implement his solution for dealing
bridge:-) Four hands of 13 cards each. I would definitely not
like to wait for the loop to finish in this case, however.)

--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

terminator

10/20/2008 8:04:00 AM

0

On Oct 19, 2:42 am, daniel.ka...@gmail.com wrote:
> I use a betting system and after 2 or 3 bets, it somehow increases the
> amount of money the user/computer has. Anyone know why that happens or
> how to possibly fix it? Lastly, can someone please help me with the
> winning conditions for this program? Thank you very much for all the
> help!
>
> Here is the code:
>
> #include <iostream>
> #include <ctime>
> #include <cmath>
> #include <windows.h>
>
> using namespace std;
>
> int compMONEYONE, compMONEYTWO, compMONEYTHREE, compMONEYFINAL;
> int compMONEY = 1000;
> int playerMONEY = 1000;
> int compBETONE, compBETTWO, compBETTHREE, compBETFINAL;
> int placeBETONE, placeBETTWO, placeBETTHREE, placeBETFINAL;
> int card[6];
> int suitC[6];
> int rankC[6];
>
> const char* rank[] = {"Ace", "Two", "Three", "Four", "Five", "Six",
> "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
> const char* suit[] = {"Hearts!", "Spades!", "Diamonds!", "Shamrock!"};
>
> int numPlayers;
> int random;
>
> char choice;
> char PlayAgain;
>
> void preGame()
> {
> srand(GetTickCount());
>
> //loop so that all the cards are different, if one is the same as
> another, the loop restarts
> do
> {
> //random number from 1-52 which is a card deck
> card[0] = ((rand() % 52) + 1);
> //cout << card[0] << endl;
> card[1] = ((rand() % 52) + 1);
> card[2] = ((rand() % 52) + 1);
> card[3] = ((rand() % 52) + 1);
> card[4] = ((rand() % 52) + 1);
> card[5] = ((rand() % 52) + 1);
> card[6] = ((rand() % 52) + 1);}while(card[0] == card[1] || card[0] == card[2] || card[0] == card[3]
>
> || card[0] == card[4] || card[0] == card[5] || card[0] == card[6] ||
> card[1] == card[2] || card[1] == card[3] || card[1] == card[4] ||
> card[1] == card[5] || card[1] == card[6] || card[2] == card[3] ||
> card[2] == card[4] || card[2] == card[5] || card[2] == card[6] ||
> card[3] == card[4] || card[3] == card[5] || card[3] == card[6] ||
> card[4] == card[5] || card[4] == card[6] || card[5] == card[6]);
>
> //ranks - ace, one, two, three, four, five, six, seven, eight, nine,
> ten, jack, queen, king
> //remainder of number which then goes through the console testing loop
> //ranks are all different or loop restarts
> do
> {
> rankC[0] = (card[0] % 13);
> //cout << rank[0] << endl;
> rankC[1] = (card[1] % 13);
> //cout << rank[1] << endl;
> rankC[2] = (card[2] % 13);
> //cout << rank[2] << endl;
> rankC[3] = (card[3] % 13);
> //cout << rank[3] << endl;
> rankC[4] = (card[4] % 13);
> //cout << rank[4] << endl;
> rankC[5] = (card[5] % 13);
> //cout << rank[5] << endl;
> rankC[6] = (card[6] % 13);
> //cout << rank[6] << endl;}while(rankC[0] == rankC[1] || rankC[0] == rankC[2] || rankC[0] ==
>
> rankC[3] || rankC[0] == rankC[4] || rankC[0] == rankC[5] || rankC[0]
> == rankC[6] || rankC[1] == rankC[2] || rankC[1] == rankC[3] ||
> rankC[1] == rankC[4] || rankC[1] == rankC[5] || rankC[1] == rankC[6]
> || rankC[2] == rankC[3] || rankC[2] == rankC[4] || rankC[2] ==
> rankC[5] || rankC[2] == rankC[6] || rankC[3] == rankC[4] || rankC[3]
> == rankC[5] || rankC[3] == rankC[6] || rankC[4] == rankC[5] ||
> rankC[4] == rankC[6] || rankC[5] == rankC[6]);
>
> //4 suits - hearts, spades, shamrocks, diamonds
> suitC[0] = (rand() % 4);
> suitC[1] = (rand() % 4);
> suitC[2] = (rand() % 4);
> suitC[3] = (rand() % 4);
> suitC[4] = (rand() % 4);
> suitC[5] = (rand() % 4);
> suitC[6] = (rand() % 4);
>
> /* if(numPlayers > 5 || numPlayers < 1)
> {
> cout << "Please enter the number of players that you would like to
> include in this game(no more than 5): ";
> cin >> numPlayers;
>
> }*/
> }
>
> void betGame()
> {
>
> cout << "Player Money Total: $" << playerMONEY << endl;
> cout << "Computer Money Total: $" << compMONEY << endl;
> // random = (rand() % 1);
>
> // if(random == 0)
> // {
> cout << "Small blind: $25 put up by the computer." << endl;
> cout << "Big blind: $50 put up by the player." << endl;
> cout << "Player Money Total: $" << playerMONEY - 50 << endl;
> cout << "Computer Money Total: $" << compMONEY - 25 << endl;
> compMONEYONE = compMONEY - 25;
> /* }
> else
> {
> cout << "Small blind: $25 put up by the player." << endl;
> cout << "Big blind: $50 put up by the computer." << endl;
> cout << "Player Money Total: $" << playerMONEY - 25 << endl;
> cout << "Computer Money Total: $" << compMONEY - 50 << endl;
>
> }*/
>
> cout << "Player's First Card: " << rank[rankC[0]] << " of " <<
> suit[suitC[0]] << endl;
>
> cout << "Player's Second Card: " << rank[rankC[1]] << " of " <<
> suit[suitC[1]] << endl;
>
> //SECOND YOU FLIP 1 CARD AND YOU SEE YOUR CARDS AND 1 CARD -- BET #2
>
> cout << "How much would you like to bet?";
> cin >> placeBETONE;
> compBETONE = (rand() % compMONEYONE);
> cout << "Computer bet: " << compBETONE << endl;
> cout << "Player Money Total: $" << playerMONEY - 50 - placeBETONE <<
> endl;
> cout << "Computer Money Total: $" << compMONEY - 25 - compBETONE <<
> endl;
> compMONEYTWO = compMONEY - 25 - compBETONE;
>
> cout << "Flop First Card: " << rank[rankC[2]] << " of " <<
> suit[suitC[2]] << endl;
>
> cout << "Flop Second Card: " << rank[rankC[3]] << " of " <<
> suit[suitC[3]] << endl;
>
> cout << "Flop Third Card: " << rank[rankC[4]] << " of " <<
> suit[suitC[4]] << endl;
>
> placeBETTWO = -1;
> while(placeBETTWO < 0 || placeBETTWO > 25)
> {
> cout << "How much would you like to bet?";
> cin >> placeBETTWO;
> compBETTWO = (rand() % compMONEYTWO);
> cout << "Computer bet: " << compBETTWO << endl;
> cout << "Player Money Total: $" << playerMONEY - 50 - placeBETONE -
> placeBETTWO << endl;
> cout << "Computer Money Total: $" << compMONEY - 25 - compBETONE -
> compBETTWO << endl;
> compMONEYTHREE = compMONEY - 25 - compBETONE - compBETTWO;
>
> cout << "Turn Card: " << rank[rankC[5]] << " of " << suit[suitC[5]] <<
> endl;
>
> }
>
> placeBETTHREE = -1;
> while(placeBETTHREE < 0 || placeBETTHREE > 25)
> {
> cout << "How much would you like to bet?";
> cin >> placeBETTHREE;
> compBETTHREE = (rand() % compMONEYTHREE);
> cout << "Computer bet: " << compBETTHREE << endl;
> cout << "Player Money Total: $" << playerMONEY - 50 - placeBETONE -
> placeBETTWO - placeBETTHREE << endl;
> cout << "Computer Money Total: $" << compMONEY - 25 - compBETONE -
> compBETTWO - compBETTHREE << endl;
> compMONEYFINAL = compMONEY - 25 - compBETONE - compBETTWO -
> compBETTHREE;
>
> cout << "River Card: " << rank[rankC[6]] << " of " << suit[suitC[6]]
> << endl;;
>
> }
>
> placeBETFINAL = -1;
> while(placeBETFINAL < 0 || placeBETFINAL > 25)
> {
> cout << "How much would you like to bet?";
> cin >> placeBETFINAL;
> compBETFINAL = (rand() % compMONEYFINAL);
> cout << "Computer bet: " << compBETFINAL << endl;
> cout << "Player Money Total: $" << playerMONEY - 50 - placeBETONE -
> placeBETTWO - placeBETTHREE - placeBETFINAL << endl;
> cout << "Computer Money Total: $" << compMONEY - 25 - compBETONE -
> compBETTWO - compBETTHREE - compBETFINAL << endl;
>
> }
>
> //WINNING CONDITIONS
>
> cout << "Do You Want To Play Again: " << endl;
> cin >> PlayAgain;
>
> }
>
> int main()
> {
> do
> {
> cout << "Welcome to Texas Hold 'Em!" << endl;
>
> preGame();
> betGame();
>
>
>
> }while(PlayAgain == 'y');
> }- Hide quoted text -
>
> - Show quoted text -

I have a problem with your randomizing strategy.you can use an
appropariate stl container(list/vector...):

enum {cardsnum=52};
somestl<int> card(cardsnum);

initialize your array

for(int i=0,somestl<int>::iterator it=card.begin();
i!=cardsnum;
(*it++)=i++);

and use the standard shuffling algorithm(i am not sure I am using the
right member function):

card.shuffle();

regards,
FM.