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.

29 lines
1023 B

1 year ago
1 year ago
1 year ago
1 year ago
  1. #include "quizduell.h"
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <ctype.h>
  6. QuizFrage erstelleFrage(const char* frage, const char* antwortA, const char* antwortB, const char* antwortC, const char* antwortD, char korrekteAntwort) {
  7. QuizFrage neueFrage;
  8. strcpy(neueFrage.frage, frage);
  9. strcpy(neueFrage.antwortA, antwortA);
  10. strcpy(neueFrage.antwortB, antwortB);
  11. strcpy(neueFrage.antwortC, antwortC);
  12. strcpy(neueFrage.antwortD, antwortD);
  13. neueFrage.korrekteAntwort = korrekteAntwort;
  14. return neueFrage;
  15. }
  16. void quizduell() {
  17. printf("Welcome to the singleplayer quizduell!\n");
  18. Kategorie kategorien[MAX_CATEGORIES];
  19. kategorien[0].fragen = (QuizFrage*)malloc(MAX_QUESTIONS_PER_CATEGORY * sizeof(QuizFrage));
  20. kategorien[0].fragen[0] = erstelleFrage("Whats the height of the Zugspitze?", "2482 Meter", "2867 Meter", "2962 Meter", "3173 Meter", 'C');
  21. kategorien[0].anzahlFragen = MAX_QUESTIONS_PER_CATEGORY;
  22. kategorien[0].joker = 1;
  23. return;
  24. }