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.
30 lines
1023 B
30 lines
1023 B
#include "quizduell.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
|
|
QuizFrage erstelleFrage(const char* frage, const char* antwortA, const char* antwortB, const char* antwortC, const char* antwortD, char korrekteAntwort) {
|
|
QuizFrage neueFrage;
|
|
strcpy(neueFrage.frage, frage);
|
|
strcpy(neueFrage.antwortA, antwortA);
|
|
strcpy(neueFrage.antwortB, antwortB);
|
|
strcpy(neueFrage.antwortC, antwortC);
|
|
strcpy(neueFrage.antwortD, antwortD);
|
|
neueFrage.korrekteAntwort = korrekteAntwort;
|
|
return neueFrage;
|
|
|
|
}
|
|
|
|
void quizduell() {
|
|
printf("Welcome to the singleplayer quizduell!\n");
|
|
|
|
Kategorie kategorien[MAX_CATEGORIES];
|
|
kategorien[0].fragen = (QuizFrage*)malloc(MAX_QUESTIONS_PER_CATEGORY * sizeof(QuizFrage));
|
|
kategorien[0].fragen[0] = erstelleFrage("Whats the height of the Zugspitze?", "2482 Meter", "2867 Meter", "2962 Meter", "3173 Meter", 'C');
|
|
kategorien[0].anzahlFragen = MAX_QUESTIONS_PER_CATEGORY;
|
|
kategorien[0].joker = 1;
|
|
|
|
return;
|
|
|
|
}
|