Browse Source

refactoring: variable umbennant: r zu randomCard

remotes/origin/stefan
fdai7472 11 months ago
parent
commit
54dd487313
  1. 10
      src/main/c/Stefan/blackjack.c

10
src/main/c/Stefan/blackjack.c

@ -68,19 +68,19 @@ int userInputBJ(){
int getRandCard(int offset){
srand(time(NULL) + offset);
int r = rand() % ANZ_MOEGLICHE_KARTEN;
r++;
int randomCard = rand() % ANZ_MOEGLICHE_KARTEN;
randomCard++;
// 11, 12, 13 = Bube, Dame, König haben den Wert 10
if(r > 10){
if(randomCard > 10){
return 10;
}
// Ass (1) hat erstmal den Wert 11
else if(r == 1){
else if(randomCard == 1){
return 11;
}
return r;
return randomCard;
}

Loading…
Cancel
Save