Browse Source

refactoring: Funktion checkForMaxWin() vereinfacht

remotes/origin/stefan
fdai7472 11 months ago
parent
commit
d07abc5eea
  1. 6
      src/main/c/Stefan/slot_machine.c

6
src/main/c/Stefan/slot_machine.c

@ -134,14 +134,12 @@ int getWinnings(char symbols[], int bet){
} }
bool checkForMaxWin(char symbols[]){ bool checkForMaxWin(char symbols[]){
bool maxWin = true;
for(int i = 1; i < NUM_OF_SYMBOLS; i++){ for(int i = 1; i < NUM_OF_SYMBOLS; i++){
if(symbols[0] != symbols[i]){ if(symbols[0] != symbols[i]){
maxWin = false;
return maxWin;
return false;
} }
} }
return maxWin;
return true;
} }
void showResult(char symbols[], int winnings){ void showResult(char symbols[], int winnings){

Loading…
Cancel
Save