Browse Source

While-Schleife für Spiel v2

remotes/origin/Pascal
Pascal Schneider 11 months ago
parent
commit
5735fc3a51
  1. 8
      src/timequiz.c

8
src/timequiz.c

@ -60,6 +60,14 @@ void timequiz() {
while (elapsedTime < 60 && totalAnsweredQuestions < totalQuestions) { while (elapsedTime < 60 && totalAnsweredQuestions < totalQuestions) {
int questionIndex = getRandomQuestionIndex(askedQuestions, totalQuestions); int questionIndex = getRandomQuestionIndex(askedQuestions, totalQuestions);
askedQuestions[questionIndex] = 1; askedQuestions[questionIndex] = 1;
int correctIndex = correctAnswers[questionIndex] - 1;
displayQuestion(questions[questionIndex], answers[questionIndex], correctIndex);
int userAnswer;
printf("Answer (1-4): ");
scanf_s("%d", &userAnswer);
} }
} }

Loading…
Cancel
Save