Browse Source

functional 12: Erweiterung Fragenpool, Anpassung rand(), Anzeige verlorenes Geld bei lose

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

18
src/wwm.c

@ -24,7 +24,12 @@ void wwm(){
"What is the capital of Germany?",
"What is the largest desert in the world?",
"In which country would you find the Great Wall?",
"How many meters are in a kilometer?"
"How many meters are in a kilometer?",
"How many colors are there in a rainbow?",
"What is the square root of 25?",
"Who painted the Mona Lisa?",
"What is the largest ocean on earth?",
"What is the largest planet in our solar system?"
};
const char* answers[][4] = {
@ -32,7 +37,12 @@ void wwm(){
{"Munich", "Berlin", "Cologne", "Frankfurt am Main"},
{"Antarctica", "Sahara", "Gobi", "Arctica" },
{"USA", "China", "Russia", "Japan"},
{"100", "10", "1", "1000"}
{"100", "10", "1", "1000"},
{"6", "7", "8", "9"},
{"5", "25", "20", "10"},
{"Vincent van Gogh", "Pablo Picasso", "Leonardo da Vinci", "Michelangelo"},
{"Pacific Ocean", "Atlantic Ocean", "Arctic Ocean", "Indian Ocean"},
{"Merkur", "Jupiter", "Neptun", "Pluto"}
};
int correctAnswer[] = {
@ -43,7 +53,7 @@ void wwm(){
for (int r = 1; r <= 15; r++){
printf("You are at stage %d and have %d $\n", runde, geld);
srand(time(0));
int frage = rand() % 5;
int frage = rand() % 10;
printf("Question %d: %s\n", runde + 1, question[frage]);
for (int i = 0; i < 4; i++) {
@ -60,7 +70,7 @@ void wwm(){
setGeld(runde);
}
else {
printf("What a shame! That is wrong!\n");
printf("What a shame! That is wrong!\n You lost %d $", geld);
}
}

Loading…
Cancel
Save