You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
835 B

  1. #include <time.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include "wwm.h"
  5. int runde = 0;
  6. int geld = 0;
  7. int aktuellGeld = 0;
  8. void wwm(){
  9. printf("Welcome to ´Who wants to be a millionaire?´ \n");
  10. printf("You are at stage %d and have %d $\n", runde, geld);
  11. const char* question[] = {
  12. "Which planet is known as the `blue planet`?",
  13. "What is the capital of Germany?",
  14. "What is the largest desert in the world?"
  15. };
  16. const char* answers[][4] = {
  17. {"Mars", "Venus", "Earth", "Jupiter"},
  18. {"Munich", "Berlin", "Cologne", "Frankfurt am Main"},
  19. {"Antarctica", "Sahara", "Gobi", "Arctica" }
  20. };
  21. int correctAnswer[] = {
  22. 3, 2, 1
  23. };
  24. srand(time(0));
  25. int frage = rand() % 5;
  26. printf("Question %d: %s\n", runde + 1, question[frage]);
  27. for (int i = 0; i < 4; i++) {
  28. printf("%d. %s \n", i + 1, answers[frage][i]);
  29. return;
  30. }