From 54dd487313b5423303d582bc4fc9adb0a2c9083e Mon Sep 17 00:00:00 2001 From: fdai7472 Date: Tue, 6 Feb 2024 12:52:47 +0100 Subject: [PATCH] refactoring: variable umbennant: r zu randomCard --- src/main/c/Stefan/blackjack.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/c/Stefan/blackjack.c b/src/main/c/Stefan/blackjack.c index 4935dc3..ff54699 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() % 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; }