From d07abc5eeaebdad83e4f88af65825902e805e27e Mon Sep 17 00:00:00 2001 From: fdai7472 Date: Wed, 7 Feb 2024 12:05:38 +0100 Subject: [PATCH] refactoring: Funktion checkForMaxWin() vereinfacht --- src/main/c/Stefan/slot_machine.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/c/Stefan/slot_machine.c b/src/main/c/Stefan/slot_machine.c index d959827..3819894 100644 --- a/src/main/c/Stefan/slot_machine.c +++ b/src/main/c/Stefan/slot_machine.c @@ -134,14 +134,12 @@ int getWinnings(char symbols[], int bet){ } bool checkForMaxWin(char symbols[]){ - bool maxWin = true; for(int i = 1; i < NUM_OF_SYMBOLS; i++){ if(symbols[0] != symbols[i]){ - maxWin = false; - return maxWin; + return false; } } - return maxWin; + return true; } void showResult(char symbols[], int winnings){