|
|
@ -8,6 +8,8 @@ int geld = 0; |
|
|
|
int frage = 0; |
|
|
|
int useranswer; |
|
|
|
|
|
|
|
int ceingabe(); |
|
|
|
|
|
|
|
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]; |
|
|
@ -22,10 +24,24 @@ int crandomNumber() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ccheckAnswer(int useranswer) { |
|
|
|
if (useranswer == 5) { |
|
|
|
printf("That is a shame, but ok.\n"); |
|
|
|
printf("Congratulations! You have won %d $!", geld); |
|
|
|
exit(0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int ceingabe() { |
|
|
|
printf("Your answer (1-4):"); |
|
|
|
scanf("%d", &useranswer); |
|
|
|
int result = scanf_s("%d", &useranswer); |
|
|
|
if (result == 0) { |
|
|
|
printf("Please enter a number beetween 1 and 4 to answer or 5 to end the game!\n"); |
|
|
|
while (getchar() != '\n') |
|
|
|
return ceingabe(); |
|
|
|
return useranswer; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
void wwm(){ |
|
|
|