Code:
void blackjackGame()
{
/* Spades, Clubs, Diamonds, Hearts. */
char* deckOfCards[DECK_SIZE] = {"2S", "2C", "2D", "2H",
"3S", "3C", "3D", "3H",
"4S", "4C", "4D", "4H",
"5S", "5C", "5D", "5H",
"6S", "6C", "6D", "6H",
"7S", "7C", "7D", "7H",
"8S", "8C", "8D", "8H",
"9S", "9C", "9D", "9H",
"10S", "10C", "10D", "10H",
"JS", "JC", "JD", "JH",
"QS", "QC", "QD", "QH",
"KS", "KC", "KD", "KH",
"AS", "AC", "AD", "AH"};*
int player1Total,
int player2Total; /* Hold totals per hand */
int playerLost; /* Used as flag */
char reply; /* Holds user input */
do
{ /* Begin Hand */
player1Total=0;
player2Total=0;
playerLost = NO;
printf("\nBlackJack21\n\n");
}
while((reply != 's') && (playerLost == NO))
}
/* this is a function used to randomize the array of
cards char* deckofCards(DECK_SIZE) */
shuffledeck()
{
for(i=0;i<1;++i) /* Deal ONE card */
{
player1Card = (1+rand()%11);
printf("Your card is %d\n",player1Card);
playerTotal += player1Card;
}
}