From a8a92e778aeecc214cbfa9a837659ea8660f717f Mon Sep 17 00:00:00 2001 From: Christian Reum Date: Mon, 5 Feb 2024 20:07:55 +0100 Subject: [PATCH] functional 12: Erweiterung Fragenpool, Anpassung rand(), Anzeige verlorenes Geld bei lose --- src/wwm.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/wwm.c b/src/wwm.c index 1d7c0d8..945636c 100644 --- a/src/wwm.c +++ b/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); } }