diff --git a/src/main/c/Stefan/blackjack.c b/src/main/c/Stefan/blackjack.c index 112c91b..deadcdf 100644 --- a/src/main/c/Stefan/blackjack.c +++ b/src/main/c/Stefan/blackjack.c @@ -68,19 +68,19 @@ int userInputBJ(){ int getRandCard(int offset){ srand(time(NULL) + offset); - int r = rand() % 13; + int r = rand() % ANZ_MOEGLICHE_KARTEN; r++; - + // 11, 12, 13 = Bube, Dame, König haben den Wert 10 if(r > 10){ return 10; - } else if(r == 1){ + } + // Ass (1) hat erstmal den Wert 11 + else if(r == 1){ return 11; } return r; - - } diff --git a/src/main/c/Stefan/blackjack.h b/src/main/c/Stefan/blackjack.h index 3723164..f20062f 100644 --- a/src/main/c/Stefan/blackjack.h +++ b/src/main/c/Stefan/blackjack.h @@ -3,6 +3,8 @@ #include +#define ANZ_MOEGLICHE_KARTEN 13 + int blackjack(); void welcomeMessageBJ(); int getBalanceBJ();