I get so many errors and I have declaired things like int iCard [13]={0}. and the i,j,m,l,k are not defined why I can see where I defined it. but then it tells me that it is un-used or undefined in scope... Please explain why I am getting such messages, am I declairing them right?
int main()
{
bool bPlayerDraw [5] ; //Boolean to determine if player holds (F)
//or draws card (T)
char cPlay = 'N'; //Character variable for play game input
int cCardDeck [4] [13]; //Character array representing the card deck
int iCard [13]={0} ; //Card array index
//0 = 2 card
//1 = 3 card
//2 = 4 card
//3 = 5 card
//4 = 6 card
//5 = 7 card
//6 = 8 card
//7 = 9 card
//8 = 10 card
//9 = Jack card
//10 = Queen card
//11 = King card
//12 = Ace card
int iSuit [4] = {0}; //Suit array index
//0 = diamonds
//1 = hearts
//2 = clubs
//3 = spades
char i,j, l, m ,k ;
int iNumberOfDraws = 0 ; //Number of rounds of card draws
int iPlayerCount [5]; //Integer array to holder each player's count
//iPlayer[0] is always the dealer
int iHighestCount = 0; //Highest count for a single game
int NumberOfCards=(2); // Input number for how many cards to deal.
srand (GetTickCount()); // Initializes random "seed".
int cDeck ={0}; // deck of cards
void deal (int ,bool [4][13],char [4][13],char [5][5][2]);
void printcards (int, char [5][5][2]);
int iNumberOfPlayers = 0;
bool [4][13];
char hand [5][5][2];
cDeck= [iSuit+iCard]
{
do
cout << "Welcome to Honest Sam's Black Jack Table" << endl;
cout << "Glad to have you back!!" << endl;
cout << "Press Y or y to play or any other key to exit game"<< endl;
cin>> cPlay;
if (cPlay=='y' && cPlay == 'Y')
return (0);
}
{
NumberOfPlayers(void)
cout <<"Enter the number of players in the game, there must be at least one but no more than four."; << endl;
cin>> iNumberOfPlayers;
cout <<"Number of Players is… "<<iNumbersOfPlayers<< "Plus Dealer is… "<<iNumbersOfPlayers +1<<endl;
while (iNumberOfPlayers < 1 || iNumberOfPlayers > 4);
}
{
for
( i = 0; i <= iNumberOfPlayers; i++) //Display Dealer and Player # for display
}
void deal (bool [4] [13], char cCardDeck [4] [13],
char hand [5] [5] [2])
{
do
srand (GetTicketCount(0))
for (k=0; k<4; k++; m=0;m<13;m++);
while
cCardDeck [k] [m] = iCard [m] + iSuit [k];
}
{
for
( i=0 ; i +iNumberOfPlayers ; i ++)
if (i==0)
cout <<" Dealers hand\n "; << endl;
}
{
for (j=0; j< 5 j++)
cout << "Player" ;<< j ;<< "Hand \n";<< endl ;
}
while
(bool[4] [13])
hand [i] [j] [0]= k
hand [i] [j] [1]=l
bool [4] [13]= true;
}
void printcards (char hand[5] [5] [2])
{
for
string card[ ]={"2","3","4","5","6","7","8","9","10","jack","queen","king","ace";
}
{
for
(i=0;i<=iNumberOfPlayers ; i++)
}
if
(i==0)
cout<<"Dealers hand\n";<< endl;
else
cout<<"Player "<<i<<"s hand\n"; <<endl;
if (j=0;j<5;j++)
void printdeck(bool [4] [13],char cCardDeck[4] [13])
{
for
string card [ ]={"2","3","4","5","6","7","8","9","10","Jack","Queen","King","Ace"}
int code[ ]={4,3,5,6};
cout<<"Cards remaining in the deck\n";<<endl;
}
{
for
(i=0;i<4;i++);
}
{
for (j=0;j<13;j++);
}
{
if (used [ i ] [ j ])
cout<<( code [ i ];<<" "<<card [ j ];<<endl;
{
}
do
void printdeck (bool [4] [13],char cCardDeck [4] [13])
{
if
cCardDeck[iSuit[],iCard[]] = k + 52; //Store ASCII number of player in card deck array to indicate which //player drew the card
if (iCard == 8) //Calculate card count
iPlayerCount[k] += iCard [8] + 2
else if (iCard< 8
cout (iCard +2)
else if (iCard == 9)
cout << char(9)<< "J";
else if (iCard == 10)
<< char(9)<< "Q";
else if (iCard == 11)
cout << char(9)<< "K";
else if (iCard == 12)
else if (iCard ==1)
cout <<"is your ace a one or an eleven? [o/e]";<< endl;
char answer ='\0';
toupper(o_or_e)
if (o_or_e == 'e')
iCard = 11;
else
iCard = 1;
if (iSuit == 0)
cout << char(003); << " ";<<endl;
else if (iSuit == 1)
cout << char(004); << " ";<< endl;
else if (iSuit == 2)
cout << char(005); << " "; <<endl;
else if (iSuit == 3)
cout << char(006); <<" ";<<endl;
endif
} //Output symbol for card suit
{
if (iPlayerCount[k] == 21 ||
iPlayerCount[k] > 18 - rand()%3)
{ //Use random number to determine whether to draw another card
if (iCard < 9) //Output card
cout << char(iSuit+3);<<endl;
}
else
cout << " Hold" endl;
cout << iPlayerCount << "Final: " endl; //Output final count for each
}
{
for
(k = 0; k < iNumberOfPlayers + 1; k++) //Find highest winning count
}
{
for
(k = 0; k < iNumberOfPlayers + 1; k++);
{
{
if
(iPlayerCount[k] > iHighestCount && iPlayerCount[k] <= 21)
iHighestCount = iPlayerCount[k];
}
//Output whether dealer and players won or lost
{
for
(k = 0; k < iNumberOfPlayers + 1; k++);
}
{
if
(iPlayerCount[k] == iHighestCount)
cout << "Player number " << iPlayerCount[k] << "Winner!"<<; endl;
else
cout <<"Player number " << iPlayerCount [k] << "Bust" << endl;
endif
//Display entire drawn deck for a check of a sincere hand
cout << "Display entire card deck" <<endl;
}
{
for (k = 0; k < 13; k++)
if (k < 9)
cout << char(3)<< k + 2;
else if (k == 9)
cout << char(3)<< "J";
else if (k == 10)
cout << char(3)<< "Q";
else if (k == 11)
cout << char(3)<< "K";
else if (k ==12)
cout << char(3)<< "A";<< endl;
else if (k ==1)
endif;
}
Please use code tags. You can get them from the <> button to the right of the formatting box.
I put your code through a compiler because I found it horrendously difficult to make sense of.
Line 47: GetTickCount() is undeclared.
Line 53: Missing variable name.
Line 56: This expression makes no sense. >_>
Lines 69, 77, 91, 97: Shouldn't there be something between the } and { braces?
Lines 85, 88, and 89: Braces.
Line 104: Missing an opening brace.
Line 113: For loop is missing conditions.
Line 114: Misplaced semicolon.
Line 119: i is undeclared in that scope. It's declared in main, but that doesn't carry over to functions.
Lines 121 and 124: Braces.
Line 126: if statement confused with a for loop.
Line 128: What were you trying to do here?
Line 133: For loop missing some important syntax.
My compiler quit at about line 133 after 20 errors. I get the feeling that you tried to do too much too fast in too few sittings with too few compilations. Compile, compile, compile. That's how you'll know when you have errors.
Yes I know I have a jumbled mess, Working full time with three kids and school work is not ideal for programming as I coming to find out.
When I am not understanding is that you got different error messages then me but some are the same, could it be different compilers? Also when I hit the <> then I just put the code in between it (sorry new to this site)?