diff --git a/src/main/c/Stefan/slot_machine.c b/src/main/c/Stefan/slot_machine.c index 2a9b689..54ac3e9 100644 --- a/src/main/c/Stefan/slot_machine.c +++ b/src/main/c/Stefan/slot_machine.c @@ -89,6 +89,7 @@ void randomizeSymbols(char symbols[]){ int spin(char symbols[], int bet, int balance){ int winnings = getWinnings(symbols, bet); + showResult(symbols); return balance; } @@ -119,6 +120,13 @@ int getWinnings(char symbols[], int bet){ return winnings; } +void showResult(char symbols[]){ + + for (int i = 0; i < ROWS; i++){ + printf(" %c | %c | %c\n", symbols[i * ROWS], symbols[i * ROWS + 1], symbols[i * ROWS + 2]); + } +} + void welcomeMessage(){ printf("Herzlich Willkommen zur \n\n" " _ _ _ _ \n" diff --git a/src/main/c/Stefan/slot_machine.h b/src/main/c/Stefan/slot_machine.h index dc37dae..3639e7e 100644 --- a/src/main/c/Stefan/slot_machine.h +++ b/src/main/c/Stefan/slot_machine.h @@ -3,7 +3,7 @@ #define NUM_OF_SYMBOLS 9 -#define ROWS 9 +#define ROWS 3 void slotMachine(); void welcomeMessage(); @@ -14,5 +14,6 @@ int subtractBetFromBalance(int bet, int balance); void randomizeSymbols(char symbols[]); int spin(char symbols[], int bet, int balance); int getWinnings(char symbols[], int bet); +void showResult(char symbols[]); #endif // SLOT_MACHINE_H \ No newline at end of file