|
@ -54,6 +54,11 @@ void timequiz() { |
|
|
|
|
|
|
|
|
memset(askedQuestions, 0, sizeof(askedQuestions)); |
|
|
memset(askedQuestions, 0, sizeof(askedQuestions)); |
|
|
srand((unsigned int)time(NULL)); |
|
|
srand((unsigned int)time(NULL)); |
|
|
|
|
|
|
|
|
|
|
|
while (elapsedTime < 60 && totalAnsweredQuestions < totalQuestions) { |
|
|
|
|
|
int questionIndex = getRandomQuestionIndex(askedQuestions, totalQuestions); |
|
|
|
|
|
askedQuestions[questionIndex] = 1; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int getRandomQuestionIndex(int askedQuestions[], int totalQuestions) { |
|
|
int getRandomQuestionIndex(int askedQuestions[], int totalQuestions) { |
|
|