From 2ae4e8d7009fe78c58915157245accba12f23d52 Mon Sep 17 00:00:00 2001 From: Christian Reum Date: Mon, 5 Feb 2024 18:35:03 +0100 Subject: [PATCH] =?UTF-8?q?functional=2010:=20Implementierung=20Geldbetr?= =?UTF-8?q?=C3=A4ge=20iund=20steigen=20mit=20Runde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/wwm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wwm.c b/src/wwm.c index a8a0091..611946c 100644 --- a/src/wwm.c +++ b/src/wwm.c @@ -8,9 +8,16 @@ int geld = 0; int frage = 0; int useranswer; +int setGeld(int runde){ + int Geldstufen[] = {0, 100, 200, 300, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 125000, 250000, 500000, 1000000}; + geld = Geldstufen[runde]; + return geld; +} + + void wwm(){ + printf("Welcome to ´Who wants to be a millionaire?´ \n"); - printf("You are at stage %d and have %d $\n", runde, geld); const char* question[] = { "Which planet is known as the `blue planet`?", @@ -50,6 +57,7 @@ void wwm(){ if (useranswer == correctAnswer[frage]) { printf("That is correct!\n"); runde++; + setGeld(runde); } else { printf("What a shame! That is wrong!\n");