|
@ -88,8 +88,8 @@ void randomizeSymbols(char symbols[]){ |
|
|
|
|
|
|
|
|
int spin(char symbols[], int bet, int balance){ |
|
|
int spin(char symbols[], int bet, int balance){ |
|
|
|
|
|
|
|
|
int winnings = getWinnings(symbols, bet); |
|
|
|
|
|
showResult(symbols); |
|
|
showResult(symbols); |
|
|
|
|
|
int winnings = getWinnings(symbols, bet); |
|
|
|
|
|
|
|
|
return balance; |
|
|
return balance; |
|
|
} |
|
|
} |
|
@ -113,15 +113,20 @@ int getWinnings(char symbols[], int bet){ |
|
|
case 'C': winnings = bet * 10; break; |
|
|
case 'C': winnings = bet * 10; break; |
|
|
case 'D': winnings = bet * 20; break; |
|
|
case 'D': winnings = bet * 20; break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (winnings > 0) { |
|
|
|
|
|
printf("\nDu hast %d gewonnen!\n", winnings - bet); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
printf("\nLeider verloren.\n"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return winnings; |
|
|
return winnings; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void showResult(char symbols[]){ |
|
|
void showResult(char symbols[]){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < ROWS; i++){ |
|
|
for (int i = 0; i < ROWS; i++){ |
|
|
printf(" %c | %c | %c\n", symbols[i * ROWS], symbols[i * ROWS + 1], symbols[i * ROWS + 2]); |
|
|
printf(" %c | %c | %c\n", symbols[i * ROWS], symbols[i * ROWS + 1], symbols[i * ROWS + 2]); |
|
|
} |
|
|
} |
|
|