Code:
#include <stdio.h>
int validateCard();
int value(int card);
void endResult(int Lost, highestTotal);
int anotherCard();
void totals(int total, int numAces, int *pLost, int *pHighestTotal);
int main(void)
{
int card1, card2, total, dtotal;
int newgame, int another;
printf("Enter card: \n");
scanf("%d" , &card1);
printf("Enter card: \n");
scanf("%d" , &card2);
validateCard(card1, card2);
total = card1 + card2;
printf("%d" , total);
printf("Enter dealer total: \n");
scanf("%d" , &dtotal);
if (total < 16 || total > 27)
printf("Error Card Must Be Between 1 and 13!");
endResult(total, dtotal);
int validateCard(*c1, *c2){
if (card1 > 10)
card1 = 10;
if (card2 > 10)
card1 = 10;
}
int anotherCard(another);
printf("Another Card? (1:Yes/0:No)");
scanf("%d", &another);
if(another==1)
/* i need this to go back to main to prompt for a new card*/
else if
(another==0)
/* i need this to go to the dealers total*/
void endResult{
if (total > dtotal)
printf("You Win");
else if(dtotal > total)
printf("You Lose");
else
printf("Tie");
}
printf("Another Game? 1:Yes/0:No");
scanf("%d", &newgame);
if (newgame==1)
/* i need this to loop the game all over again*/
else if
(newgame==0)
/* i need this to end the game*/
}
if anyone can help me figure this out it would be great, also i need int numAces to have it when a the number equals 1 for ace to have it calculate ace as 1 and 11 - i have no idea how to do this so if anyone can help again please that would be awsome!
thanks,