|
@ -3,6 +3,7 @@ |
|
|
#include <stdlib.h> |
|
|
#include <stdlib.h> |
|
|
#include <time.h> |
|
|
#include <time.h> |
|
|
#include <string.h> |
|
|
#include <string.h> |
|
|
|
|
|
#include <stdbool.h> |
|
|
|
|
|
|
|
|
void slotMachine(){ |
|
|
void slotMachine(){ |
|
|
|
|
|
|
|
@ -117,6 +118,11 @@ int getWinnings(char symbols[], int bet){ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(checkForMaxWin(symbols)){ |
|
|
|
|
|
winnings *= 10; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (winnings > 0) { |
|
|
if (winnings > 0) { |
|
|
printf("\nDu hast %d gewonnen!\n", winnings - bet); |
|
|
printf("\nDu hast %d gewonnen!\n", winnings - bet); |
|
|
} |
|
|
} |
|
@ -127,6 +133,17 @@ int getWinnings(char symbols[], int bet){ |
|
|
return winnings; |
|
|
return winnings; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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 maxWin; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void showResult(char symbols[], int winnings){ |
|
|
void showResult(char symbols[], int winnings){ |
|
|
|
|
|
|
|
|
char winnerMessage[10] = {""}; |
|
|
char winnerMessage[10] = {""}; |
|
|