Browse Source

functional 14: Auslagerung int für Frage crandomNumber()

remotes/origin/Christian
Christian Reum 11 months ago
parent
commit
bc2395c19f
  1. 11
      src/wwm.c

11
src/wwm.c

@ -15,6 +15,15 @@ int setGeld(int runde){
} }
int crandomNumber() {
srand(time(NULL));
frage = rand() % 10;
return frage;
}
void wwm(){ void wwm(){
printf("Welcome to ´Who wants to be a millionaire?´ \n"); printf("Welcome to ´Who wants to be a millionaire?´ \n");
@ -60,7 +69,7 @@ void wwm(){
printf("__________________________________________________ \n\n"); printf("__________________________________________________ \n\n");
printf("You are at stage %d and have %d $\n", runde, geld); printf("You are at stage %d and have %d $\n", runde, geld);
srand(time(0)); srand(time(0));
int frage = rand() % 10;
crandomNumber();
printf("Question %d: %s\n", runde + 1, question[frage]); printf("Question %d: %s\n", runde + 1, question[frage]);
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {

Loading…
Cancel
Save