Browse Source

refactoring: konstanten Wert durch konstante Variable ersetzt

remotes/origin/stefan
fdai7472 11 months ago
parent
commit
aa64b5526b
  1. 10
      src/main/c/Stefan/blackjack.c
  2. 2
      src/main/c/Stefan/blackjack.h

10
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;
}

2
src/main/c/Stefan/blackjack.h

@ -3,6 +3,8 @@
#include <stdbool.h>
#define ANZ_MOEGLICHE_KARTEN 13
int blackjack();
void welcomeMessageBJ();
int getBalanceBJ();

Loading…
Cancel
Save