
View Code
. totalIt(playerPoints,total,PLAYER);
. totalIt( points[], total[],. ( (points[ACELOW] ==. ||(points[ACEHIGH] > . total[who] =. . total[who] =. (who ==. printf(. . printf(. . }
. ( (points[ACELOW] ==. ||(points[ACEHIGH] > . total[who] =. . total[who] =. }
if ( points[ACEHIGH] > 21 )
{
total[who] = points[ACELOW];
}
else
{
total[who] = points[ACEHIGH];
}
total[who] = ( points[ACEHIGH] > 21 )? points[ACELOW]: points[ACEHIGH];
. (who ==. printf(. . printf(. }
printf( "%s a total of %d\n\n",
who == PLAYER ? "You have" : "The house stands with",
total[who] );
void totalIt(int [],int [],int );
void totalIt(int points[],int total[],int who)
{
total[who] = ( points[ACEHIGH] > 21 )? points[ACELOW]: points[ACEHIGH];
printf( "%s a total of %d\n\n",
who == PLAYER ? "You have" : "The house stands with",
total[who] );
}
. . dealerGetsCard(&. ( dealerPoints[ACEHIGH] < );
. totalIt(dealerPoints,total,DEALER);
do
{
dealerGetsCard(&numCards,cards,dealerPoints);
totalIt(dealerPoints,total,DEALER);
}
while ( total [DEALER] < 17 );