Browse Source

refactoring: Funktion createSymbols zu randomizeSymbols umbenannt

remotes/origin/dev
fdai7472 11 months ago
parent
commit
5038d8194a
  1. 4
      src/main/c/Stefan/slot_machine.c
  2. 2
      src/main/c/Stefan/slot_machine.h

4
src/main/c/Stefan/slot_machine.c

@ -16,7 +16,7 @@ void slotMachine(){
int bet = getBet(balance); int bet = getBet(balance);
balance = subtractBetFromBalance(bet, balance); balance = subtractBetFromBalance(bet, balance);
createSymbols(symbols);
randomizeSymbols(symbols);
} }
} }
@ -53,7 +53,7 @@ int subtractBetFromBalance(int bet, int balance){
return balance - bet; return balance - bet;
} }
void createSymbols(Symbol symbols[]){
void randomizeSymbols(Symbol symbols[]){
char possibleLetter[] = "ABCD"; char possibleLetter[] = "ABCD";
int possibleValue[] = { 3,5,10,20 }; int possibleValue[] = { 3,5,10,20 };

2
src/main/c/Stefan/slot_machine.h

@ -14,6 +14,6 @@ int getBalance();
int userInput(); int userInput();
int getBet(int balance); int getBet(int balance);
int subtractBetFromBalance(int bet, int balance); int subtractBetFromBalance(int bet, int balance);
void createSymbols(Symbol symbols[]);
void randomizeSymbols(Symbol symbols[]);
#endif // SLOT_MACHINE_H #endif // SLOT_MACHINE_H
Loading…
Cancel
Save