|
|
@ -89,13 +89,15 @@ int playBJ(int bet, int balance){ |
|
|
|
int winnings = 0; |
|
|
|
int userCardsTotal = 0, dealerCardsTotal = 0; |
|
|
|
|
|
|
|
int *dealerCardsArray = (int*) malloc(10 * sizeof(int)); |
|
|
|
// Array mit max 10 Karten anlegen |
|
|
|
int *dealerCardsArray = (int*) malloc(MAX_CARDS * sizeof(int)); |
|
|
|
|
|
|
|
if(dealerCardsArray){ |
|
|
|
dealerCardsArray[0] = getRandCard(0); |
|
|
|
printf("computer rand card: %d\n", dealerCardsArray[0]); |
|
|
|
|
|
|
|
int *userCardsArray = (int*) malloc(10 * sizeof(int)); |
|
|
|
// Array mit max 10 Karten anlegen |
|
|
|
int *userCardsArray = (int*) malloc(MAX_CARDS * sizeof(int)); |
|
|
|
|
|
|
|
if(userCardsArray){ |
|
|
|
|
|
|
@ -111,7 +113,7 @@ int playBJ(int bet, int balance){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int i = 2; i < 10; i++){ |
|
|
|
for(int i = 2; i < MAX_CARDS; i++){ |
|
|
|
|
|
|
|
userCardsTotal = calculateCardsTotal(userCardsArray, i); |
|
|
|
|
|
|
@ -134,7 +136,7 @@ int playBJ(int bet, int balance){ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for(int i = 1; i < 10; i++){ |
|
|
|
for(int i = 1; i < MAX_CARDS; i++){ |
|
|
|
|
|
|
|
dealerCardsTotal = calculateCardsTotal(dealerCardsArray, i); |
|
|
|
|
|
|
|